added EAGAIN to destroy mutex, not clean solution