Assertions checking that we're on the main thread. These should probably be changed to exceptions at some point in the future.