Add assertions about which thread we are running in.