fix compatibility with cygwin pipes: be more tolerant of the pipes connected. also, duplicate handles to ensure the original handle remains valid after uv_close (esp. important for stdio)