add 'flush' support

Add support to flush every data in cache to disk at maximal speed.
This will deadlock if createWhisperFile throws an exception.