sync writing of current file to disk

see issue #47 and [the c++ version] (https://github.com/google/leveldb/commit/3c8be108bfb5fbd7d51f824199627e757279f79e#diff-da4c56b96296699bf6b20cbe9402fe08R129)