Rewind file after writing to it.