Defer threading state changes to end of frame