run shutdown hooks in finally in case no exception is thrown