fix sem_close unmapping of still-referenced semaphore