Close semaphore when done
Recreate semaphore when a new index is created
Avoid releaseing semaphores due a peek resulting in more bytes available from the file