libvirt: fix bug when releasing port(s)

During the process of deleting an instance, if
serial_console is enabled it has to check domain for
allocated port(s) to be released - Currently this is doing
after the domain has been undefined from libvirt which creates
a bug. This patch fixes the problem by moving this part of code before
undefining the domain.

Also 5fa74bc0b2 moves that part of code inside the method
_detach_encrypted_volumes which has nothing to do here.

Change-Id: Ie187748deff7b0143d1ca26e767c6665746094c5
Closes-Bug: #1366832
Merge "libvirt: fix bug when releasing port(s)"