winpthreads: mutex.c: improve `pthread_mutex_destroy`

Check whether mutex passed to `pthread_mutex_destroy` is owned by any thread,
including the calling thread, and fail with EBUSY in such case.

Signed-off-by: Kirill Makurin <maiddaisuki@outlook.com>
Signed-off-by: LIU Hao <lh_mouse@126.com>
1 file changed