Fixed broken sessions appeared when connection to DB was lost on authentication check for transactional method
Fixed incorrect session shutdown in some cases