Adds main-thread-check assertion.