Debounce bug fix.
Debounce bug fix.

Checked for state change before checking for timeout, so noisy
connection could cause an infinite loop. Moved timeout check to top of
cond.

froggey/Mezzano,froggey/Mezzano