Check the RESTART environment variable before closing fd's 0-2 since the previous approach broke upgrades to bzr >= 500.