Sphere.exit() turned out to be problematic as it was implemented using a longjmp and apparently Allegro didn't like that, causing a crash on exit. So I replaced it with Sphere.shutDown() which simply instructs the event loop to exit, similarly to how ExitMapEngine() works in Sphere 1.x.
Sphere.exit();Dispatch.onUpdate(doStuff);
Sphere.shutDown()Dispatch.onUpdate(doStuff);