Fix exit on error, don't call main exit as that kills everything in a disorderly fashion, just exit from the
current thread.