We need to clear the trim part of the accounting arrays, otherwise
we can use bogus values leading to attempting to allocate huge
amounts of memory. This causes fio to exit with:
fio: pid=21428, err=12/file:memory.c:242, func=iomem allocation,
error=Cannot allocate memory
Also improve the depth detection, by making it per data direction
instead of a global state.
Signed-off-by: Jens Axboe <axboe@fb.com>