switches: optimize handleVlan to set values only if they are different