Close entity manager factory

Fix #163 (EntityManagerFactory instances not closed)
Fix #136 (Web app redeploy memory leaks)