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: I85627b21e660e23a49d8984dedd6d8723dd86410
Closes-bug: #1371380
Merge "Delete the old virtual_machine of a port when device_id is updated"