blockdev-wipe: Reduce progress indicator granularity to 1/1000
blockdev-wipe: Allocate buffer from heap instead of stack

This allows to use buffers larger than 8M, also it fails more
gracefully in case the memory can't be allocated.
blockdev-wipe: Sync at most once per second

Don't open output devices with O_SYNC, instead sync manually
every time the progress indicator is updated, but not more
often than once per second.  This yields performance gains
of up to factor 10 in setups with dm-crypt on dm-raid.

Note: Seven years ago, O_SYNC was added to fix OOM issues
(cf. bug #381135), however it is believed that this problem
has been addressed in the kernel by now.
blockdev-wipe: Set blocksize to 512k

This should be large enough to avoid excessive system call
overhead and small enough to prevent problems on systems with
very little RAM.
Use configured crypto options for volume wiping

Wiping of crypto volumes is done by setting up dmcrypt for the volume, filling
it with zeroes and then forgetting the key.  Previously, for the transient
crypto-volume, always the configuration "aes xts-plain64 128" had been used.
In the case the user chose a stronger setting, eg. "aes xts-plain64 256", this
meant that wiping occured with less security than encryption, i.e. metadata
was protected less than the actual data.

This changeset causes crypto_wipe_device() to read the encryption settings of
the to-be-wiped volume and to use them for wiping, too.
Add a bit of logging to crypto_wipe_device()
Clean up local variables in crypto_setup()
Use different templates for two kinds of overwriting