use poll() instead of select()

After much wrangling, it appears the multi-thread race
condition may have been due to improper use of select(); i.e.
failing to check for signal interruptions. Use poll() anyway,
because it's nicer.