Import l3 port query fix

The upstream patch in https://review.openstack.org/#/c/27985/2
does not apply cleanly, so this is a hand-crafted, artisnal,
version of that patch.

Change-Id: I470b019169144d91125194e862322dfd00e9b8c4
Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
Merge pull request #1 from dhellmann/l3db-query-fix

Import l3 port query fix