Implement SimpleSemaphore with try finally clause