add assertion to catch a double ph_job_free()
avoid fault when printf'ing a null ph_string_t
extend epoch around the full set of events from epoll

The observation was that a mixture of timer and fd events coming back in
a batch would operate on the same job; one would cause the underlying
data to be ph_job_free()'d and reaped by the time the second one was
dispatched.

The equivalent to this should also be applied to the other nbio
implementations.

Also: fix missing mask assignment in the removal case.
sock: fixup stuck SSL sessions, tidy up free and affinity

* For async connects, round-robin over the emitters for the completion
  callback for better distribution.  You may use the new
  ph_thread_emitter_affinity() function to obtain an affinity value
  for the currently executing thread.  This is useful in cases where
  you create a job for a connected socket and want to maintain
  affinity with the connection callback thread (this is usually
  desirable in order to minimize the chance that you schedule the
  same fd in two different epoll instances on different threads)

* For longer lived SSL sessions and/or systems under load with a
  large number of concrrent SSL sessions, we observed that we could
  get stuck pending read with partial data in the read buffer.
  The data was actually read and staged somewhere in the SSL internals.
  Avoid getting stuck by performing a speculative read after a dispatch;
  if the read buffer size changed then we make another pass through
  the dispatch callback.  This looks fugly and can bias towards
  hot sessions, but works well in practice thus far.
Remove hyperthreading check on Linux

This has been made obsolete by the thread affinity controls
for thread pools, and in fact gets in the way of managing
affinity directly because of the way we mod the assignment
over the number of detected physical cores.
handle more wakeup edge cases

Do a better job at handling edge cases where we can try to operate
on a job that has been scheduled for deferred free.

We do this by performing more sanity checks for the pending-free state
to avoid enqueuing more work that will likely trigger post-free

Note that this was deployed in concert with setting
$.nbio.max_per_wakeup = 1 to reduce the chances that we try to operate
on a stale view of the event state (the wakeups were across threads).
fix my lint error
include stdarg.h in log.h, since it's necessary
only define _POSIX_C_SOURCE and _BSD_SOURCE if they're not already defined
avoid looping on error

I saw some cases where we'd get stuck looping after hitting a broken
pipe.  If we detect an error, avoid triggering the speculative
read/write logic that was recently added for ssl enabled sockets
improve handling in a couple more edge cases

No reason to roll back a partial operation on a bufq when the API
provides a mechanism for indicating a partial.

Treat EINTR and EINPROGRESS similarly to EAGAIN for fd operations.
disable fini routines by default

Added an --enable-placate-valgrind configure switch to turn them back
on.

They're problematic (read: unsafe) if you have C++ code that triggers
during global destruction and calls into libphenom.  They only exist
so that valgrind doesn't report leaks, so let's turn them off by
default.
Merge branch 'master' of https://github.com/facebook/libphenom
Merge branch 'master' into compilation-fixes