Put stdout and stderr files in temp dirs

Do not remove temp dirs if there was an error