[fvm][zcrypt] Fix logic bug in encrypted I/O

A logic bug existed in the read/write implementation for
zxcrypt-encrypted volumes which could cause reads or writes to return
ZX_ERR_INVALID_ARGS.

The bug occurs when reading or writing over a fragmented region, where
one of the fragments completely fills the 1MiB transfer buffer.  This
would result in a zero-length operation being enqueued as well, which is
always invalid.

Bug: 478029520
Tested: Included a test case which I verified fails before change.
Change-Id: I2032238bcd5d78639564e6c5b57f58d7ea438b2b
2 files changed