revlog: avoid opening and closing the file for each cloned revision
The previous code was flushing files after each new revision, slowing things
down.
For exemple, with this change, the evolve repository can run
`hg debugupgraderepo --run --optimize re-delta-parent` in about 3.4s instead of
4.5 seconds.