Java FFI global compilation fix

Fixes:
* Undefined references on unused callbacks with nitg-g
* Duplicated functions on callbacks present in 2 modules