Switch to |fs.close| calling |fs.flush|

Issue #388.
- Adds a dirty flag to our FD, updates it on write/truncate/flush
- Only flush if the dirty flag is set
- |fs.close| calls flush
Hmm, *Connection.truncateImpl* is supposed to truncate to *newLength*, but this new implementation doesn't appear to do that.