Add AIX support, explicitly close stdin in open3 block.