fix a null reference exception pointed out by blog commenter (Sumant), as welll as fixed a race condition where DetectStale may break the Rx contract and call OnNext at the same time from two different threads.