some gccs barf on pragma diagnostic push

So let's just be explicit about what we want to happen
affinity: make listener round-robin the accepted sock
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).
'Slot' should be put before the compare expression to guarantee thread safe.
It's not thread safe.

Use concurrency kit cas to make thread safe.
Fix thread-unsafe bug.
fix line wrapping & use ck_pr_faa_8
add null ptr check in ph_string_equal_cstr

See https://github.com/facebook/libphenom/issues/29 for context
fix potential use-after-free with ares

Noticed this while digging into
https://github.com/facebook/libphenom/issues/29:

```
==26939== Invalid write of size 8
==26939==    at 0x10000AFD8: ph_job_set_nbio (in ./tests/dns.t)
==26939==    by 0x10000388B: sock_state_cb (in ./tests/dns.t)
==26939==    by 0xCD79: ares__close_sockets (in /usr/local/Cellar/c-ares/1.10.0/lib/libcares.2.dylib)
==26939==    by 0xD976: ares__destroy_servers_state (in /usr/local/Cellar/c-ares/1.10.0/lib/libcares.2.dylib)
==26939==    by 0xD871: ares_destroy (in /usr/local/Cellar/c-ares/1.10.0/lib/libcares.2.dylib)
==26939==    by 0x100003AC7: do_ares_fini (in ./tests/dns.t)
==26939==    by 0x100001C0F: ph_library_teardown (in ./tests/dns.t)
==26939==    by 0x2FC524: __cxa_finalize (in /usr/lib/system/libsystem_c.dylib)
==26939==    by 0x2FE68A: exit (in /usr/lib/system/libsystem_c.dylib)
==26939==    by 0x2667E7: start (in /usr/lib/system/libdyld.dylib)
==26939==  Address 0x100105950 is 16 bytes inside a block of size 120 free'd
/*
==26939==    at 0x75B8: free (in /usr/local/Cellar/valgrind/HEAD/lib/valgrind/vgpreload_memcheck-amd64-darwin.so)
==26939==    by 0x100009DB7: ph_mem_free (in ./tests/dns.t)
==26939==    by 0x1000038A6: sock_state_cb (in ./tests/dns.t)
==26939==    by 0xCD79: ares__close_sockets (in /usr/local/Cellar/c-ares/1.10.0/lib/libcares.2.dylib)
==26939==    by 0xD976: ares__destroy_servers_state (in /usr/local/Cellar/c-ares/1.10.0/lib/libcares.2.dylib)
/*
==26939==    by 0xD871: ares_destroy (in /usr/local/Cellar/c-ares/1.10.0/lib/libcares.2.dylib)
==26939==    by 0x100003AC7: do_ares_fini (in ./tests/dns.t)
==26939==    by 0x100001C0F: ph_library_teardown (in ./tests/dns.t)
==26939==    by 0x2FC524: __cxa_finalize (in /usr/lib/system/libsystem_c.dylib)
==26939==    by 0x2FE68A: exit (in /usr/lib/system/libsystem_c.dylib)
==26939==    by 0x2667E7: start (in /usr/lib/system/libdyld.dylib)
```

I only saw it once, so seems hard to trigger, but nonetheless:
Switch to using a job template and SMR to address this.
fixup doc entry name matching

Adding `PH_` for macros meant that struct ph_job was being mislabeled
as a PH_STAILQ_ENTRY.  Make the title check prefer `struct`s that start
the line.  This duplicates a later rule that matches `struct` anywhere
in the line because it is late and I'm too lazy to check to see what
might be affected if I remove the latter.
pretty print json for the docs

Not sure if this was breaking gh-pages or if something else broke it
around the same time... but having put this code together, might
as well check it in now.
improve cross-links in the variant docs
more crosslinks for variant docs
add helper for getting at a c-string rendition of a ph_string_t

Docs explain it; we prefer to copy (or not copy if possible) to the
stack over using the heap.  The rationale is that most of the strings
we'll pass to c-string APIs will be small enough that stack will be
appropriate; my immediate use case is passing strings to posix APIs
for use as filenames.
auto generation of proper tags

For context, see:

https://github.com/facebook/libphenom/pull/28
https://github.com/facebook/libphenom/pull/30
add ph_thread_pool_signal_stop()

This allows tearing down the threads when they are no longer required.
This doesn't free the underlying pool (it's considered permanent)
fixup c++ compilation

and add some docs for the job template stuff
rampage against automake: move aux dir

The new test-driver stuff that lands in the top level is rage inducing
when it comes to tab completion.  Move it aside!
add ph_stm_copy()

Another one that I always end up wanting/needing.

Also: tweak the test harness to make it clearer when the plan is messed
up by colorizing things... and also have it detect bogus printf
formatting.
add unistd.h for SEEK_SET