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