Moved mutex specific functions from wait.c to mutex.c