Delete switch and switch ports from database properly. This change fixes a problem that they are deleted accidentally by a virtual network manager which is off duty.