check validity of semaphores in netconn_free. Closes #2