Eliminate flapping live lock on jdbc connection pool.

Abstract model test was not closing entity managers.  Now ensure that
previous entity manager was closed, releasing connections.