Move common thread_wait functionality into one function
Fix 100% CPU when capturing in *nix

Use behavior from rb_io_wait_readable instead of rb_thread_wait_fd when
doing a blocking read (via each_packet or each_data).  This fixes a bug
that caused 100% CPU utilization when using `each` in a single threaded
application on linux.  This also allows ruby to properly respond to
signals (such as SIGINT sent by CTRL_C) when blocked waiting for data.

We can't use rb_io_wait_readable directly because libpcap doesn't seem
to populate errno like a normal IO function.

See also:
http://blog.phusion.nl/2010/06/10/making-ruby-threadable-properly-handling-context-switching-in-native-extensions/
Remove unnecessary timeout when waiting for data on Windows