add middle-of-block test on t.001.write
undup: implement truncate and properly handle extending writes
undup_write: fix sub-block overwrites.

In the case where a write is in the middle of a page, we were wrongly
writing NULs to the portion of the page after the write, overwriting
valid data.  Unclear if there is any valid case where stub_read would
return a non-full-page, but since the interface permits it to do so,
correctly handle this case (rather than simply deleting the currently
unused memset codepath).