ODE-952: fixing session handling bug. Thanks to Sathwik for the patch!

git-svn-id: https://svn.apache.org/repos/asf/ode/trunk@1225610 13f79535-47bb-0310-9956-ffa450edef68
fixing ODE-998, thanks to Michael McEniry for the patch.