Add test for a write that enlarges the internal buffer and for ftruncate. Fixes #224.