C++ fix: put jobject on stack and re-insert it to map after transfer.