Fixed issue #1244

Added also the support for the new end() method in
OCommandResultListener to release resources seclared in anonymous
classes for asynch queries.