Make sure that even loop does not break when system interrupt is received

Loop will still break if anything else happens with select.select call
(e.g., when handle becomes invalid)