Launcher: fix #1721 by keeping the classloader open when called from main