Fixed file corruption bug in flogfs_write