Main sleeps for fixing Android firefox canvas resize race condition