valgrind complains memory leak due to lack of sem_close()