Add a process lock.
Add a process lock.

This lock is basically a more robust version of what
multiprocessing.Lock does.  That implementation uses semaphores
internally which require cleanup/deallocation code to run to release
the lock; a SIGKILL hitting the process holding the lock violates those
assumptions leading to a stuck lock.

Thus this implementation is based around locking of a deleted tempfile;
lockf locks are guranteed to be released once the process/fd is closed.

BUG=chromium-os:26913
TEST=grab I1b958a09, and sigkill the outer cbuildbot

Change-Id: Iba6cda1151df0a0e9859391f4d6dbdac606ff0b1
Reviewed-on: https://gerrit.chromium.org/gerrit/17365
Tested-by: Brian Harring <fdc2d0a2e2340b623587cee5ea8dff425d1eb1f3@chromium.org>
Reviewed-by: David James <f231dc574bbeb62604660cbc162d1b8642a0a3af@chromium.org>
Reviewed-by: Mike Frysinger <8f3f75c74bd5184edcfa6534cab3c13a00a2f794@chromium.org>
Commit-Ready: Brian Harring <fdc2d0a2e2340b623587cee5ea8dff425d1eb1f3@chromium.org>

zhang0137/chromite,zhang0137/chromite,chadversary/chromiumos.chromite,bpsinc-native/src_third_party_chromite,coreos/chromite,coreos/chromite,bpsinc-native/src_third_party_chromite,zhang0137/chromite,bpsinc-native/src_third_party_chromite,coreos/chromite,chadversary/chromiumos.chromite