release db before returning from authenticate
Merge pull request #2798 from emrul/master

release db before returning from authenticate