Fix check to clear READ_OP and EPOLLIN. Part of [#2254]