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
This was pretty convoluted before: open, ftruncate, flush, close. Now it's just truncate.