Rework meshopt_Allocator callback storage
Using templated class static allowed us to avoid function calls even in unoptimized builds, but results in conflicts with Clang's C++20 module implementation when meshoptimizer.h is included in global module fragment. Instead, we now use a function static to store this state and require a function call to get access to it.
Additionally, while allocator callbacks were deduplicated by the linker
within an individual module, when meshoptimizer was compiled as a
shared library the library code and the calling code would get
separate configuration, and allocator overrides would not affect temporary
allocations done by meshopt_IndexAdapter. To fix that, this PR introduces
a separate configuration option, MESHOPTIMIZER_ALLOC_EXPORT,
which can be used to declare the allocator storage function in the library
once.
Fixes #895.
This contribution is sponsored by Valve.