Fix memory and resource leak on closed Sessions (JAVA-342, JAVA-390).
Merge branch '2.0' into 2.1