download-from-binary-cache.pl: Get rid of an uninitialized value warning

Reported by Pablo Costa.
Shut up a compiler warning
Show which function argument was unexpected

Fixes #116.
Show function names in error messages

Functions in Nix are anonymous, but if they're assigned to a
variable/attribute, we can use the variable/attribute name in error
messages, e.g.

while evaluating `concatMapStrings' at `/nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/pkgs/lib/strings.nix:18:25':
...
build-remote.pl: Indicate if remote machine is refusing builds

Fixes #120.
build-remote.pl: Copy all outputs in one operation
nix-store --export: Export paths in topologically sorted order

Fixes #118.
.bashrc -> .profile
build-remote.pl: Remove meaningless signing when importing the output paths

The "$UID != 0" makes no sense: if the local side has write access to
the Nix store (which is always the case) then it doesn't matter if
we're root - we can import unsigned paths either way.
download-from-binary-cache.pl: Treat a 403 error as a 404

Amazon S3 returns HTTP status code 403 if a file doesn't exist and the
user has no permission to list the contents of the bucket.  So treat
it as 404 (meaning it's cached in the NARExistence table).
Update the default binary cache URL to cache.nixos.org
download-from-binary-cache.pl: Fix race condition

Fixes the error "DBD::SQLite::db do failed: column url is not unique".
Buffer reads from the substituter

This greatly reduces the number of system calls.
Process stderr from substituters while doing have/info queries
Remove obsolete EOF checks
download-from-binary-cache.pl: Show if we're waiting for a URL

Previously, if a binary cache is hanging/unreachable/slow,
download-from-binary-cache.pl would also hang without any indication
to the user.  Now, if fetching a URL takes more than 5 seconds, it
will print a message to that effect.
Replace $NIX_DEBUG_SUBST with an option ‘debug-subst’

Thus passing ‘--option debug-subst 1’ allows daemon users to turn on
debug info and see what the substituter is doing.
download-from-binary-cache.pl: Respect $NIX_CONNECT_TIMEOUT
nix-daemon: Trust options like binary-caches when the client is root

Fixes #127.
In repair mode, update the hash of rebuilt paths

Otherwise subsequent invocations of "--repair" will keep rebuilding
the path.  This only happens if the path content differs between
builds (e.g. due to timestamps).