kernel - x86_64 - Add additional checks to lwp_wait() & friends
* lwp_wait() must defer reaping of a lwp that is still running on another
cpu (i.e. in the midst of exiting).
* It shouldn't be possible for this to happen but just incase the thread
gets switched out after TDF_EXITING has been set, also make sure
the threat is no longer on the LWKT run queue.
* Remove old debugging in the LWKT scheduler path.
* Protect gd_freetd (per-cpu td cache) with a critical section. Again
this case should not occur as new threads are not allocated from
interrupts, but protect it anyway. Also assert that the cached free
td is in no way still scheduled.
Note that this cache is required to ensure that the td does not
end up in the MP-accessible objcache before it has been fully
descheduled.