Catch errors when duping stdin

Fixes #6657