Fix fdopen mode-compatibility test and errno setting.
Fix fdopen mode-compatibility test and errno setting.

joel-porquet/tsar-uclibc,joel-porquet/tsar-uclibc,joel-porquet/tsar-uclibc,joel-porquet/tsar-uclibc