Re-included the means to prevent the main thread from exiting until the vm is exited elsewhere (either Ctrl+C, terminateJVM, etc.)