In some situations when an application uses a lot of file descriptors (like > 1024), event handling in gpgme fails miserably.
As a library, it is better to use poll instead of select.
There are (relatively minor) corner cases for portability in difference between poll and select (about regular files, /dev/null, sockets, and what event is detected how), but for the use cases in gpgme, this patch works well.