Add an option to start ML code in main (root) thread
In newer versions of Mac OS X, Apple libraries attempt to assert and
enforce that all UI code and event handling code be run from the main
thread. This swaps the polymain logic such that we start ML code from
the main thread and handle termination in the newly spawned thread
through the option --mainthreadml 1