Greenlet/IOLoop Semaphore implementation to fix deadlock

Summary:
pymongo was enforcing connection limits using semaphores, which deadlock
in our single-threaded greenlet/tornado setup. Implemented a
greenlet/tornado friendly semaphore and using that to protect the
connection pool instead.

Test Plan:
Ran into connection limit without timeout, confirmed blocking forever
without errors.

Ran into connection limit with timeout, confirmed error after timeout
period.

Ran below connection limit, confirmed no issues.

Will do more testing in production late at night.

Reviewers: jack, david, tarek, josh, bill

Maniphest Tasks: T15228

Differential Revision: http://phab.wish.com/D21415