EXOGTN-1704: Hibernate session leak with idm database

Fix description:
* Ending the request lifecycle should be added to the finally bloc to be always executed even if an exception is encountered