Fixing block open file on write

The previous strategy can cause a race condition sometimes. The current
one is a little more reliable.

Also, the intermediate files should be removed before run the pipeline
again, now we can leave them there.
Increasing minor version