allow process.exit to be replaced