issue #1005 - partial fix: load .mat files, run garbage collector before detaching thread from Java