Prevent CPP callback functions from being GCed