Fixed issue when model sets are closed before the creation of any entity manager.

Change-Id: I26dd33599aad7f2b645ca36b5b72cf6b2bd58835