Use locking in runners.docker.build

Also add some unit tests for runners.docker
Fix handling end of gerrit stream
Update TODO