Fix for Bug 456389 - Memory leak in PreparedSubquery