Print alive objects on SIGINT, SIGTERM, SIGABRT and SIGSEGV

To try and make debugging leaks at termination or crash time easier.
Merge pull request #4 from pwithnall/sigint

Print alive objects on SIGINT, SIGTERM, SIGABRT and SIGSEGV
Fix an unpaired mutex unlock

This may have been causing the random memory corruptions. Whoops.
Merge pull request #5 from pwithnall/locking-bug

Fix an unpaired mutex unlock