Make sure the timeout is valid before clearing it.

Signed-off-by: Nick Campbell <nicholas.j.campbell@gmail.com>