tar: port to Solaris 9

Problem reported by Jesse C in:
http://lists.gnu.org/archive/html/bug-tar/2014-03/msg00034.html
* gnulib.modules: Add strtoimax and strtoumax, since tar invokes
these functions directly and they don't exist on Solaris 9.
Fail if archive comes from a terminal.

Based on patch from Pavel Raiskup <praiskup@redhat.com>.

* gnulib.modules: Add new modules.
* src/buffer.c (_open_archive): Refuse to read archive from a tty.
* tests/Makefile.am (TESTSUITE_AT): Add iotty.at
(check_PROGRAMS): New program ttyemu
* tests/testsuite.at: Include iotty.at
* tests/iotty.at: New file.
* tests/ttyemu.c: New file.
fix an eternal loop in handle_option

* src/names.c (handle_option): increment loop counter