Lint, clean up, and test inbox.util.file, make Lock() gevent-safe.

Summary:
This is part of debugging some locking related issues in the sync
code. Turns out that when I switched the Gmail sync stuff to use a file
lock, I also totally broke the locking behaviour, because flock() is a
_process level_ lock, and if you try to grab that lock from multiple
greenlets, it will happily return and say that you have the lock. This
modifies the locking to be much more strict; you can only grab the lock
once, and only from one greenlet, and if you release it more times than
you grab it it will also throw an exception.

Test Plan: Tests included in tests/general/test_lock.py and
           tests/general/test_misc_utils.py

Reviewers: emfree

Differential Revision: https://review.inboxapp.com/D100