Fix Looper.getMainLooper NPE when called in Application constructor.

Closes #895.