mussel,test: refactor wait_for_instance_state_is().