Consolidate counter and thread TLS data, revise init

Tackle a couple of things:

* Both threads and counters had their own copies of code to manage
  allocations and TLS data; consolidate it into one
* Resolve some initialization issues
* Addresses https://github.com/facebook/libphenom/issues/11 by
  removing the dependency on ph_mem_alloc for ph_thread_t data

This gives us better defined initialization semantics both within
the library and for the client applications that consume it.

It also reduces some boilerplate with pthread_once and the (albeit
very very small) overhead that introduced into the various call sites.

The new initialization approach uses the `constructor` attribute of
gcc to cause a shim function to run prior to `main`.  This shim function
registers the true constructor/destructor functions and arranges for
them to run at `ph_library_init` time.

Using the linker to manage construction means that we'll only pull
in the pieces that are used in the application.

gcc supports specifying priorities for constructors but this isn't
available to all systems (notably Solaris).