ah, good point. the device closes as soon as no consumers are connected to the MidiIn or no producers are connected to the MidiOut.
an Enable pin is a bit problematic here since you can have the MidiIn/Out as as many times as you want with the same device. so what would it mean if one is enabled and the other disabled? at some point we might have a window where you can see the open devices/resources that are being used.
for now you can disable the connection by using a switch node with a non-connected pin like this: