ensureMainThread

Ensures that method invocation happened on main thread

Throws

if current thread is not the main thread