core: Use better error code when using select with a too high fd.
* src/posix-io.c (_gpgme_io_select): Return EMFILE instead of EBADF.
Also EBADF seem more correct, EMFILE (Too man open files) gives
a clearer message to the user that there are somehow too many files
open. The problem can be exhibited by running lots of threads,
We should eventually move to poll but that would be a large change and
so we better fix it with the planned migration of the I/O subsystem to
libgpgrt (currently known as libgpg-error).
- Signed-off-by: Werner Koch <wk@gnupg.org>