added flush that waits for io to finish
Merge pull request #1 from mafintosh/master

added flush that waits for io to finish