Don't hang after initial send when using -t or -z

The command to set the dataset readonly after sending it for the first
time was erroneously including the extra pipeline components for
receiving via xz and/or a temp file, so the 'zfs set' would work, but
then sit waiting forever for a pipeline that was not hooked up to
anything.
Use pv rather than trickle for bandwidth limiting

pv is installed in the default configuration on the platforms I care
about, whereas trickle is not.
Rename local $error to $error_msg

To avoid shadowing the global 'error' function.
Extract age reporting into a function

This allows its variables defined to be local, and will allow calling
it more than once.
Don't use global $DEST in expire_src_snaps

Also add a quick note about the parameters it's called with.
Use a source pool lock rather than a global one

There's no need for this lock to be global as its purpose is to prevent
snapshots on the source pool being manipulated by multiple runs at once.
Extract the actual mirroring into a function

As with age reporting, this allows its variables to be local, and will
eventually allow for it to be called more than once.
Refactor and rename get_destinations
Re-organise file layout

Re-order into sections containing:
* global variable declarations
* function definitions
* code
Replace [ for tests with [[
Tidy up a lot of variable quoting
Extract listing of snapshot numbers into dedicated function

Lists the numbers of all zfs-mirror snapshots present on the given
dataset.
Define lockfile paths before registering cleanup

Otherwise if the initial sanity checks for the presence of source and
dest pools failed, cleanup would be called without having the lockfile
paths defined, and fail.
Make get_pv_cmd take snapshot names as separate args

Rather than passing its argument(s) directly to 'zfs send' for size
estimation, take either the name of one snapshot, or a source and
target snapshot for an incremental send. This allows the snapshot names
passed to 'zfs send' to be correctly quoted.
Start improving variable naming

This principally consists of using named locals rather than using
numbered parameters directly.
Assorted cleanups
Start improving parameter quoting
Add facility to log estimated send sizes to file
Fix a couple of uses of $?

These functions tested the value of $?, but were not called within 'if'
checks, so could not be reached as the script would have already exited
at this point, since we are using 'set -e'.
Add ability to specify multiple destinations

The destination argument now accepts a comma-separated list.

Several errors are demoted to warnings, where it would be possible to
continue to do some useful work. This is intended to avoid the
situation where two pools are given, but an error with the first
prevents the second from even being tried.

If any warnings are encountered which would previously have been
errors, the return value of the script is the most recent error code.