Fix Hibernate Init and Destroy

There was a bug where ServiceRegistry were not destroy. The result was not destroyed Hibernate Thread that was hold the proccess run.
Merge-commit with ksbobrov/examples fork