add 'flush' support

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