Fix crash in sampgdk_callback_register()