Implemented IO.dup.
Merge pull request #227 from MagLev/matthias/IO_dup

Implemented IO.dup.