it may happen that an EOF condition is not properly detected during
execution of the handle_messages() method, thus making the waiting step
in process() hang forever.
This adds a check for the EOF condition once every 10 timeouts while
consuming messages.