Add zfs_trim_zero parameter.

This patch adds a new module tunable: zfs_trim_zero. When this
parameter is set to 1, ZFS makes sure that DKIOCTRIM zeroes the range
being TRIMmed. This makes data corruption issues easier to reproduce,
at the cost of greatly decreased performance.

On disk vdevs, zfs_trim_zero replaces DISCARD with zero page writes,
which means it will work even with vdevs that do not support DISCARD.
Note that DISCARD won't be used even on vdevs that support it.

On file vdevs, if FALLOC_FL_PUNCH_HOLE fails and zfs_trim_zero=1, then
a zero buffer will be written instead. It is not necessary to write
zeroes if hole punching works because FALLOC_FL_PUNCH_HOLE specifies
that the specified range must appear as zeroes after hole punching.
Use zfs_trim_zero=1 in ztest.

For ztest to reliably check for corruption issues in the TRIM code, we
need to make sure TRIM zeroes data, even if the underlying filesystem
doesn't support file hole punching.
Fix assertion failure due to stale inflight writes.

ztest runs with TRIM enabled on a backing filesystem that doesn't
support hole punching revealed the following race condition:

 1. A write is issued to a vdev and added to the TRIM map inflight
    writes tree.
 2. The very first TRIM request for this vdev is issued.
 3. The TRIM request fails with EOPNOTSUPP, as expected. vdev_notrim
    is set.
 4. The write completes. trim_map_write_done() is called.
 5. trim_map_write_done() sees that vdev_notrim is set, and returns
    immediately.
 6. As a result, the write stays in the TRIM map inflight writes tree
    forever.
 7. When the vdev is closed, trim_map_destroy() tries to destroy the
    inflight writes tree, which triggers an assertion failure because
    it isn't empty.

This patch fixes the issue by removing the check on vdev_notrim in
trim_map_write_done().
Fix assertion failure due to inflight frees.

ztest runs with TRIM enabled revealed a race condition which occurs when
a vdev close is pending while there are TRIM requests in flight. When
the TRIM ZIOs complete, the SPA lock is released. The SPA lock is then
immediately taken by the vdev close path, which calls trim_map_destroy()
before trim_map_vdev_commit_done() has a chance to run.
trim_map_destroy() then tries to destroy the inflight free tree, which
fails with an assertion failure because it is non-empty.

This patch fixes the issue by making trim_map_destroy() call
trim_map_vdev_commit_done() before destroying the TRIM map.
Fix TRIM with ashift=12.

With ashift=12, zio_vdev_io_start() expands all ZIOs with size < 4096
using zio_push_transform(), allocating a new ZIO buffer in the process.

The allocation is of course unnecessary for DKIOCTRIM ZIOs, which don't
hold any data. This patch makes sure a new buffer is only allocated on
read/write ZIOs.

This also fixes an assertion failure in __vdev_disk_physio because it
was called with DISCARD and a non-null data buffer, which makes no
sense.
Add ZIO TRIM statistics.

This patch adds a new kstat page: zio_trim, which indicates the total
number of bytes TRIMmed, and the number of successful, unsupported and
failed TRIM requests. This makes it easy to verify if TRIM is actually
working or not.