Ensure cleanup threads works through timeouts