Fix a RunContext so it run only once

There was a race condition causing a generator to run multiple times if
the temp directory rimraf action was too fast.