ISPN-4651 LevelDB crashes JVM when stop() is called concurrently with write()

https://issues.jboss.org/browse/ISPN-4651
This should be done in a proper try finally block.  If a reinitDatabase method threw an IOException the semaphore would be irreparably broken.