C API: fix device + colocation edge case in import_graph_def
This change makes the C API consistent with the Python API, by making
sure that all nodes in a colocation group have the device of the op
named in the "_class" attr (all other ops' devices are ignored). This
is currently done by preserving the current Python logic for
colocation and devices, which only works if all ops start with no
device set. Without this change, imported nodes would have the device
specified in the GraphDef. This change unsets any device before
running the Python logic.
PiperOrigin-RevId:
189859688