Avoid workspace-wide locks when building.

There is no reason to lock the workspace when building a project. Markers already
lock the required resources, and the build should just lock the current project.

Fixed #1001631.
Merge pull request #360 from dragos/issue/fine-grained-locks-build-1001631

Avoid workspace-wide locks when building.