Handle case in addThread when both arguments are the same

attachThread calls addThread with both arguments being the same pointer, but the current assert and expect checks expect mutually exclusive states for the two arguments. This pull request adds Thread::NoState to the allowable states for the t argument to match what we require from p's state.