Protecting against timeout race-condition for error handling.