Fixed some wrong sem_waits/sem_posts by checking the commented lines before removing them
Added function to output success of sem_destroys