Handle null hook pointers.

NLua calls LuaSetHook with a null func pointer to clear the debug hook (and others may as well), but Marshal.GetFunctionPointerForDelegate does not allow this.