Flush file to disk after writing it.