More work on named semaphores

Right now, named semaphores will work as long as the process exits
gracefully. If a process is CTRL-C'd, then the semaphores are not
cleaned up and they will cause hangs next time the process is run.

This needs fixing.