EG/TS: added exitOnError flag to registerShutdownHandler.