mmg: use app->SafeYield() instead of while(app->Pending()) app->Dispatch()

The latter seems to hang endlessly on Mac OS.