Updates clear_db() to unregister models and close session.
Updates clear_db() to unregister models and close session.

fixes bug 1080988

This change fixes the bug by ensuring the metadata and session objects
are properly cleaned up by clear_db(). Using the proper calls reduces
the memory required by unit tests.

Change-Id: I1d1802b642eff83b7f96211608195afaf68e855a

ykaneko/neutron,citrix-openstack-build/neutron,NeCTAR-RC/neutron,klmitch/neutron,Brocade-OpenSource/OpenStack-DNRM-Neutron,waltBB/neutron_read,yamahata/neutron,mmnelemane/neutron,bigswitch/neutron,magic0704/neutron,ykaneko/neutron,netscaler/neutron,sasukeh/neutron,armando-migliaccio/neutron,zhhf/charging,cloudbase/neutron-virtualbox,aristanetworks/neutron,bgxavier/neutron,rossella/neutron,yamt/neutron,sajuptpm/neutron-ipam,aristanetworks/arista-ovs-quantum,infobloxopen/neutron,CiscoSystems/quantum,vijayendrabvs/ssl-neutron,vijayendrabvs/ssl-neutron,noironetworks/neutron,yamahata/tacker,watonyweng/neutron,sajuptpm/neutron-ipam,cloudbase/neutron-virtualbox,MaximNevrov/neutron,yamt/neutron,CiscoSystems/neutron,eonpatapon/neutron,liqin75/vse-vpnaas-plugin,Metaswitch/calico-neutron,paninetworks/neutron,paninetworks/neutron,armando-migliaccio/neutron,liqin75/vse-vpnaas-plugin,rickerc/neutron_audit,Juniper/contrail-dev-neutron,vveerava/Openstack,alexandrucoman/vbox-neutron-agent,vijayendrabvs/hap,Juniper/contrail-dev-neutron,rossella/neutron,sajuptpm/neutron-ipam,beagles/neutron_hacking,JioCloud/neutron,Stavitsky/neutron,CiscoSystems/neutron,rossella/neutron,silenci/neutron,cisco-openstack/neutron,asgard-lab/neutron,neoareslinux/neutron,pnavarro/neutron,redhat-openstack/neutron,wolverineav/neutron,CiscoSystems/quantum,takeshineshiro/neutron,SamYaple/neutron,watonyweng/neutron,gopal1cloud/neutron,CiscoSystems/vespa,aristanetworks/neutron,adelina-t/neutron,aristanetworks/arista-ovs-quantum,Juniper/neutron,Juniper/neutron,armando-migliaccio/neutron,glove747/liberty-neutron,jacknjzhou/neutron,adelina-t/neutron,ykaneko/quantum,miyakz1192/neutron,eayunstack/neutron,cloudbase/neutron,huntxu/neutron,ykaneko/quantum,tpaszkowski/quantum,suneeth51/neutron,huntxu/neutron,tpaszkowski/quantum,silenci/neutron,rdo-management/neutron,CiscoSystems/neutron,kaiweifan/neutron,citrix-openstack-build/neutron,yanheven/neutron,Comcast/neutron,glove747/liberty-neutron,dhanunjaya/neutron,barnsnake351/neutron,vbannai/neutron,mmnelemane/neutron,tpaszkowski/quantum,ykaneko/quantum,CiscoSystems/vespa,JianyuWang/neutron,magic0704/neutron,jerryz1982/neutron,vivekanand1101/neutron,mattt416/neutron,gkotton/neutron,netscaler/neutron,tpaszkowski/quantum,projectcalico/calico-neutron,chitr/neutron,oeeagle/quantum,javaos74/neutron,yamahata/tacker,gkotton/neutron,zhhf/charging,jumpojoy/neutron,noironetworks/neutron,kaiweifan/neutron,chitr/neutron,rickerc/neutron_audit,vijayendrabvs/ssl-neutron,vijayendrabvs/hap,yamahata/neutron,jerryz1982/neutron,leeseulstack/openstack,cloudbase/neutron,swdream/neutron,mahak/neutron,openstack/neutron,Comcast/neutron,openstack/neutron,aristanetworks/arista-ovs-quantum,cernops/neutron,Comcast/neutron,ykaneko/quantum,infobloxopen/neutron,barnsnake351/neutron,gkotton/neutron,bigswitch/neutron,citrix-openstack-build/neutron,dims/neutron,yamt/neutron,klmitch/neutron,jumpojoy/neutron,kaiweifan/vse-lbaas-plugin-poc,wenhuizhang/neutron,virtualopensystems/neutron,MaximNevrov/neutron,skyddv/neutron,neoareslinux/neutron,liqin75/vse-vpnaas-plugin,shahbazn/neutron,cernops/neutron,javaos74/neutron,ntt-sic/neutron,takeshineshiro/neutron,virtualopensystems/neutron,blueboxgroup/neutron,openstack/neutron,Metaswitch/calico-neutron,beagles/neutron_hacking,mattt416/neutron,bgxavier/neutron,rossella/neutron,Stavitsky/neutron,leeseulstack/openstack,projectcalico/calico-neutron,vbannai/neutron,yuewko/neutron,leeseuljeong/leeseulstack_neutron,yamahata/neutron,armando-migliaccio/neutron,igor-toga/local-snat,antonioUnina/neutron,mahak/neutron,dims/neutron,vveerava/Openstack,rdo-management/neutron,netscaler/neutron,antonioUnina/neutron,alexandrucoman/vbox-neutron-agent,ykaneko/neutron,leeseuljeong/leeseulstack_neutron,gopal1cloud/neutron,vivekanand1101/neutron,asgard-lab/neutron,ntt-sic/neutron,blueboxgroup/neutron,vijayendrabvs/hap,SmartInfrastructures/neutron,rickerc/neutron_audit,mandeepdhami/neutron,shahbazn/neutron,skyddv/neutron,yanheven/neutron,miyakz1192/neutron,beagles/neutron_hacking,sebrandon1/neutron,oeeagle/quantum,SmartInfrastructures/neutron,sebrandon1/neutron,Brocade-OpenSource/OpenStack-DNRM-Neutron,swdream/neutron,NeCTAR-RC/neutron,redhat-openstack/neutron,virtualopensystems/neutron,leeseuljeong/leeseulstack_neutron,leeseulstack/openstack,eonpatapon/neutron,aristanetworks/arista-ovs-quantum,kaiweifan/neutron,yamt/neutron,waltBB/neutron_read,JianyuWang/neutron,jacknjzhou/neutron,igor-toga/local-snat,suneeth51/neutron,CiscoSystems/vespa,vbannai/neutron,yuewko/neutron,mandeepdhami/neutron,kaiweifan/vse-lbaas-plugin-poc,JioCloud/neutron,zhhf/charging,ntt-sic/neutron,liqin75/vse-vpnaas-plugin,CiscoSystems/quantum,yamahata/tacker,sasukeh/neutron,wenhuizhang/neutron,cisco-openstack/neutron,vveerava/Openstack,Juniper/contrail-dev-neutron,blueboxgroup/neutron,Juniper/neutron,mahak/neutron,apporc/neutron,apporc/neutron,Brocade-OpenSource/OpenStack-DNRM-Neutron,eayunstack/neutron,kaiweifan/vse-lbaas-plugin-poc,kaiweifan/vse-lbaas-plugin-poc,dhanunjaya/neutron,pnavarro/neutron,SamYaple/neutron,wolverineav/neutron