hooks.c: handle invalid mutex in pthread_mutex_destroy

Patch originally done by Ricardo Mendonza (ricardo.mendoza@canonical.com)

Signed-off-by: Ricardo Salveti de Araujo <ricardo.salveti@canonical.com>
Merge pull request #80 from rsalveti/handle-invalid-mutex-destroy

hooks.c: handle invalid mutex in pthread_mutex_destroy