Make all access to Context's lock via helpers

`context._lock` should be an implementation detail with callers only concerned with acquire_lock and release_lock.

Testing Done:
https://travis-ci.org/pantsbuild/pants/builds/41820893

Bugs closed: 818

Reviewed at https://rbcommons.com/s/twitter/r/1391/
Sync of https://github.com/pantsbuild/pants/commit/775805015f0e6c212267ce34e91fc3a5cf3a6b2d