The main loop implementation is quite performance critical. The GSource
is now reused, instead of creating new once each time. Also a timeout of
-1 will now be handled correctly in nativePollOnce().
Adds a special treatment for the main Looper to not block in java code,
but instead return to glib managed thread loop. Timeouts in the mainloop
are now handled using g_timeout_add_full().
Also defer Activity construction, so that every thing is set up properly
when the constructor runs.