[baseutils] added a reference queue to allow to keep refs to java events but to release the refs from a C module