Added -fPIC.
Destroy mutex after use in mutex_lock_unlock.c.

Prevents future reporting of resource leak.
Simple circular-lock-order test case.
HELHEIM_DECLARE_OVERRIDE() macro.

Allows overrides both pthread_mutex_{lock,unlock} to call the original
functions HELHEIM_ORIG(pthread_mutex_{lock,unlock}).
New logging macros in helheim.h

HELHEIM_INFO for verbose messages, HELHEIM_ERROR for reporting user
errors and HELHEIM_FATAL for fatal errors that require abortion.
Move _GNU_SOURCE define to gyp file.

This definition is required for RTLD_NEXT and also enables definitions
of PTHREAD_MUTEX_DEFAULT, PTHREAD_MUTEX_RECURSIVE without the _NP
suffixes. If there's a more portable way to do this (so that Helheim can
build and work on BSD for instance), that would definitely be
preferrable.
Make helheim_init_* functions static.

These functions do not need to be exported, this keeps the symbol table
clean.
Added error checks for helheim_load_func.
Simple lock-unlock test under separate thread.
Replace constructor initalizers with once guards.

Otherwise other libraries' initializers could run pthread_mutex_lock
etc. before initializers had ben run, causing Helheim to call a null
pointer (or garbage) as the function hadn't been loaded.
Basic lock-order-cycle detection for mutexes.

Uses a DAG, detects if any lock-order cycles would be added by adding a lock. If
so they are not added, and an error is instead reported.

Also renames HELHEIM_FETCH_ORIGINAL() to HELHEIM_FETCH_ORIG(), for
consistency with HELHEIM_ORIG().