Remove dead code
startProcess: Make writing error messages from the child more robust
nix-daemon: Use a thread instead of SIGPOLL to catch client disconnects

The thread calls poll() to wait until a HUP (or other error event)
happens on the client connection. If so, it sends SIGINT to the main
thread, which is then cleaned up normally. This is much nicer than
messing around with SIGPOLL.
nix-store --serve: Monitor for client disconnects

This is necessary because build-remote.pl now builds via ‘nix-store
--serve’. So if a build hangs without writing to stdout/stderr, and
the client disconnects, then we need to detect that.
nix-daemon: Simplify stderr handling
nix-daemon: Less verbosity
Pass -pthread only for programs that need it
Remove some obsolete files
Remove some dead code
Add some assertions
More debugging
Fix bogus pass by reference

http://hydra.nixos.org/build/12711659
Use pthread_cancel instead of a signal

Signal handlers are process-wide, so sending SIGINT to the monitor
thread will cause the normal SIGINT handler to run. This sets the
isInterrupted flag, which is not what we want. So use pthread_cancel
instead.
tests/remote-builds.nix: Don't try cache.nixos.org
nix-store --serve: Only monitor stdin during builds

Other operations cannot hang indefinitely (except when we're reading
from stdin, in which case we'll notice a client disconnect). But
monitoring works badly during compressed imports, since there the
client can close the connection before we've sent an ack.

http://hydra.nixos.org/build/12711638
tests/remote-builds.nix: Test failing build
Refactor
build-remote.pl: Be less verbose on failing builds
Implement nix-copy-closure --from via nix-store --serve
Remove obsolete SSH master connection code