cpp: store copy of C++ callback function instead of pointer to function
cpp: store copy of C++ callback function instead of pointer to function

In the current code base, it shouldn't matter that much
whether a pointer to the callback function is stored or a copy,
but parts of the code will be reused for supporting persistent
callbacks and for those it is not safe to store a mere pointer
since the copy needs to survive beyond the scope of the function
that sets the callback.

Signed-off-by: Sven Verdoolaege <235c10dd23b819f81cdc9756a251746bc184cab6@gmail.com>

Meinersbur/isl,Meinersbur/isl,Meinersbur/isl,Meinersbur/isl