Use STDIN_FILENO constant rather than fileno(stdin) and same for stderr in bam_mate.c.