fix entity manager factory memory leaks
Merge pull request #269 from dennishendriksen/master

Close entity manager factory