Handle EINTR in pkg_query_select.