WIP: Forbid repository access when in lock

Open Kamil Trzcińśki requested to merge forbid-repository-access into master

This is proof of concept

What does this MR do?

Makes sure that we are not accessing any repository data during lock, because accessing FS is catastrophic :)

Why was this MR needed?

To make sure that we do not lock for longer than needed.

Screenshots (if relevant)

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

To fix things like this: https://gitlab.com/gitlab-org/gitlab-ce/issues/23503