Correctly shutdown the runtime after the REPL's termination.