Recover gracefully from java :main as repl init-ns

refs #977, #1034