clean up shm and sem more cleanly.