Making the exception caught during os.dup of stdin explicit

Related to f23bb34