In case messages with unexpected IDs are received, the previous code would always wait for the full timeout again.