Lock management: store LockAccess instances in class instances

Moves some common code of converting between Lock and LockAccess to a common
place.
Merge branch 'LockAccessPatch' of git://github.com/jaredgrubb/buildbot
fix minor pyflakes
Merge branch 'pull617'
fix docs