immediately return from mainloop if parser is not initialized

thanks to Andrew O'Brien for the patch