CLOUDSTACK-6676: cleanup ip address details on ip disassoc

(cherry picked from commit 66df43572e1a12ad2bd32f8c0aa9acaeb271828e)
CLOUDSTACK-6853: Search for non-removed nics only when check if the running vm belongs to a certain network

(cherry picked from commit 03623fe57e6597782b628815140283151d066a36)
Fixed unittest

(cherry picked from commit 96bfa8a73f0054db42beaff6a8ba3af058d3d915)
CLOUDSTACK-6793: Fixed an invalid Domain Id Issue

Signed-off-by: sedukull <santhosh.edukulla@gmail.com>
(cherry picked from commit 91d054cb00f6a5818f2be1c7e4d3f44a2c58bfcc)
try-with-resource to prevent resource leaks

(cherry picked from commit 39f775c38126bb25a0418f82196caaba463f8c1c)
CLOUDSTACK-6585: added missing db upgrade statements

(cherry picked from commit 9e2db2f2210904752eea2f3abf87b16bb3080384)