Merge branch 'andrey-starodubtsev-directorargout_and_java_typemaps'

* andrey-starodubtsev-directorargout_and_java_typemaps:
  WIP: #704 (java directorargout + java/typemaps.i fixes)
  WIP: #704 (java directorargout + java/typemaps.i fixes)
  WIP: #704 (java directorargout + java/typemaps.i fixes)
  WIP: #704 (java directorargout + java/typemaps.i fixes)
  WIP: #704 (java directorargout + java/typemaps.i fixes)
  a lot of memory leak (local refs) fixed
  java directorargout + java/typemaps.i fixes