Fix FFI global compilation on duplicated callbacks across modules

Replaces #739.

Fixes the C++ FFI bug and also the underlying C FFI bug. Still compiles the implementation of callbacks only once, but generates the redirections and aliases for each modules.