Move global struct relay_data to struct recovery_state
Implement non-blocking version of cord_join()

Other changes:

 * Saving/re-throwing original exception caused cord to terminate
Add memset() to cord_start() and fix potential bug in cord_join()
Fix #578: Rewrite JOIN handler to use pthreads instead of fork()
Merge remote-tracking branch 'origin/master' into gh-578-join-thread
gh-578: review fixes

Fix obvious coding bugs in cord_cojoin/cord_join().

Remove unnecessary constants & arguments.
Keep an eye on the include dependencies becoming more messy.
Clear the O_NONBLOCK flag in the join thread, which
uses non-blocking API.
Suspend I/O in the main thread event loop for the
duration of replication join/subscribe.