Fix race condition in project locking.

We did the unlocking in a different thread, which does not seem like a
good idea.

Change-Id: Id3427bf52e993011d0f18b0d7f526901e31e9c30
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Rename "lockBuildGraph" to "lockProject".

To distinguish this lock better from the build graph file lock.

Change-Id: Ib520bea568c5f9bf0ea5c87347f5576d82c935c4
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>