Fix tests related to upstream changes

Upstream neutron change on database API:

Sync db code from oslo-incubator
Change-Id: I0e1d86878d3eb924b01e04dced0f90b4e57757d8