expect.py: handle timeout in expect_retval properly