Invoke on main thread.

This fixes some long term UI glitches and improves overal performance
and stability.