Implement `lock()` and `unlock()` methods on the `Project` API to enable memoization on read-only projects.