Changed dos_handles to store dups of stdio/out/err as per Ove Kaaven's