While trying to delete subnets, some failed with DetachedInstanceError,
because 'port' is not part of 'IPAllocation' object when accessed
outside the DB session(in which 'IPAllocation' object was created).
To avoid this error, we call get_port explicitly before using the port.
This issue is not seen on master branch as recent code refactor[1] is
also calling get_port there.
[1] https://review.openstack.org/#/c/428774/
Closes-bug: #1672701
Change-Id: I924fa7e36ea9e45bf0ef3480972341a851bda86c
(cherry picked from commit b9242c348c)