Prevent quit() being called more than once.