Use a global lock on ProfileRegistry instead of individual ProfileVersion locks.
Access to the git workspace must be locked, which can only ever point to one version.