Rework CardThread locking and threading

Allow the timing code in the CardThread.run() method to do its work in
place of these rather ugly spinlocks.