Don't build on Ubuntu 10.10

Its C++ compiler is too old.

http://hydra.nixos.org/build/12385722
Fix compilation error on some versions of GCC

src/libexpr/primops.cc:42:8: error: looser throw specifier for 'virtual nix::InvalidPathError::~InvalidPathError()'
src/libexpr/nixexpr.hh:12:1: error:   overriding 'virtual nix::EvalError::~EvalError() noexcept (true)'

http://hydra.nixos.org/build/12385750
Add a test for the SSH substituter
Fix security hole in ‘nix-store --serve’

Since it didn't check that the path received from the client is a
store path, the client could dump any path in the file system.
nix-copy-closure: Fix race condition

There is a long-standing race condition when copying a closure to a
remote machine, particularly affecting build-remote.pl: the client
first asks the remote machine which paths it already has, then copies
over the missing paths. If the garbage collector kicks in on the
remote machine between the first and second step, the already-present
paths may be deleted. The missing paths may then refer to deleted
paths, causing nix-copy-closure to fail. The client now performs both
steps using a single remote Nix call (using ‘nix-store --serve’),
locking all paths in the closure while querying.

I changed the --serve protocol a bit (getting rid of QueryCommand), so
this breaks the SSH substituter from older versions. But it was marked
experimental anyway.

Fixes #141.
Remove maybeVfork
nix-copy-closure: Restore compression and the progress viewer
Refactoring: Move all fork handling into a higher-order function

C++11 lambdas ftw.
Remove tabs
nix-copy-closure: Fix --dry-run
nix-copy-closure -s: Do substitutions via ‘nix-store --serve’

This means we no longer need an SSH master connection, since we only
execute a single command on the remote host.
Fix use of sysread
Replace message "importing path <...>" with "exporting path <...>"

This causes nix-copy-closure to show what it's doing before rather
than after.
Fix broken Pid constructor
Allow $NIX_BUILD_HOOK to be relative to Nix libexec directory
Fix closure size display
build-remote.pl: Use ‘nix-store --serve’ on the remote side

This makes things more efficient (we don't need to use an SSH master
connection, and we only start a single remote process) and gets rid of
locking issues (the remote nix-store process will keep inputs and
outputs locked as long as they're needed).

It also makes it more or less secure to connect directly to the root
account on the build machine, using a forced command
(e.g. ‘command="nix-store --serve --write"’). This bypasses the Nix
daemon and is therefore more efficient.

Also, don't call nix-store to import the output paths.
Fix test
build-remote.pl: Fix build log
build-remote.pl: Don't keep a shell process around