Port reduction crash fix

fix for issue :
When CBN code changes and cause less number of ports like : 
________
|a=1; | > |                                ________
|        |    |           ->                  | c=3; | > |            (2 output ports to 1 output port)
|b=2; | > |                                --------------
--------------

Then any connector attached to the port being deleted will redraw itself, and will crash when it cannot find the port model. 

 Tried to simulate this in a test by opening a file and changing the code directly. Didnt work :| Not sure how to test this.