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

gkotton/vmware-nsx,gkotton/vmware-nsx