Add explicit project-level locking with lock types
This offers different types of locking within a project.
Specifically, it prevents the worker from locking up the frontends when it gets
a project-wide lock, while still ensuring that multiple workers can't work on
the same project.
Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>