Stack saving handler will abort if curthread does not match the thread set for capture. However, no attempt is made to keep said thread on cpu and by the time NMI is received it could have been preempted. Claim the NMI even if the thread does not match and instead let the issuer know about the failure by setting stack depth to 0.
Another fix would to be thread lock around this.
Also note there is still a hypothetical bug where the pointer matches, but the actual thread exited and the area got reallocated.