* libio/Makefile: Add rules to build and run test-freopen. * libio/test-freopen.c: New file. * libio/test-freopen.sh: New file.