Semaphore: add context manager interface

This allows writing:

"""
s = Semaphore(...)
with s:
    print('Inside critical section')
"""
instead of
"""
s = Semaphore(...)
s.acquire()
print('Inside critical section')
s.release()
"""

The __enter__ method calls acquire with default arguments. If this isn't
appropriate for your usage, you will need to explicitly call acquire().
Ignore compiled files