Delete the old virtual_machine of a port when device_id is updated

When the device_id of a port is updated, the old virtual_machine
associated with the port is not deleted.
This patch tries to fix this problem.

Also it allows the device_id to be updated with empty value.

Change-Id: I143bc707290cf140d64e6d527a73ae331d79b92c
Closes-bug: #1371380
Merge "Delete the old virtual_machine of a port when device_id is updated" into R1.10