U.S. judge reinstates New York presidential primary cancelled by state