In some cases, wires with the same name were being re-created.
This affected both the creation of shared primitive ports and changing
the wire type if the cell had an additional function.
Here, we separate wire creation and type change into a separate function and use it in most cases.
Addresses: https://github.com/YosysHQ/nextpnr/issues/1759
Signed-off-by: YRabbit <rabbit@yrabbit.cyou>