Mono/C#: Fix _update_exports possible crash with Reference types
Mono/C#: Fix _update_exports possible crash with Reference types

The code was attempting to dynamic cast the native instance to Reference after
the managed instance was disposed. As the managed instance acts as a Ref,
the native instance was freed during that disposal.
This made the dynamic cast fail and we attempted to memdelete a second time.

The fix is to make the dynamic cast before disposal.

guilhermefelipecgs/godot,guilhermefelipecgs/godot,Paulloz/godot,Shockblast/godot,Zylann/godot,vnen/godot,vkbsb/godot,ex/godot,pkowal1982/godot,DmitriySalnikov/godot,ex/godot,vkbsb/godot,ex/godot,firefly2442/godot,Valentactive/godot,akien-mga/godot,firefly2442/godot,honix/godot,pkowal1982/godot,akien-mga/godot,Zylann/godot,josempans/godot,Valentactive/godot,pkowal1982/godot,Shockblast/godot,Shockblast/godot,ex/godot,ex/godot,sanikoyes/godot,MarianoGnu/godot,BastiaanOlij/godot,DmitriySalnikov/godot,vnen/godot,akien-mga/godot,ex/godot,DmitriySalnikov/godot,ZuBsPaCe/godot,firefly2442/godot,josempans/godot,honix/godot,firefly2442/godot,Valentactive/godot,Valentactive/godot,godotengine/godot,ZuBsPaCe/godot,vnen/godot,guilhermefelipecgs/godot,vkbsb/godot,ZuBsPaCe/godot,honix/godot,Paulloz/godot,akien-mga/godot,vnen/godot,Paulloz/godot,Valentactive/godot,guilhermefelipecgs/godot,Zylann/godot,godotengine/godot,Shockblast/godot,josempans/godot,Faless/godot,Zylann/godot,MarianoGnu/godot,pkowal1982/godot,Faless/godot,vnen/godot,pkowal1982/godot,akien-mga/godot,firefly2442/godot,akien-mga/godot,Paulloz/godot,BastiaanOlij/godot,godotengine/godot,ZuBsPaCe/godot,vkbsb/godot,BastiaanOlij/godot,firefly2442/godot,pkowal1982/godot,ZuBsPaCe/godot,honix/godot,BastiaanOlij/godot,sanikoyes/godot,ex/godot,Shockblast/godot,BastiaanOlij/godot,sanikoyes/godot,DmitriySalnikov/godot,sanikoyes/godot,josempans/godot,firefly2442/godot,MarianoGnu/godot,Zylann/godot,ex/godot,Shockblast/godot,vnen/godot,ZuBsPaCe/godot,Shockblast/godot,akien-mga/godot,MarianoGnu/godot,vkbsb/godot,godotengine/godot,DmitriySalnikov/godot,ZuBsPaCe/godot,josempans/godot,vkbsb/godot,sanikoyes/godot,Zylann/godot,vnen/godot,sanikoyes/godot,josempans/godot,pkowal1982/godot,guilhermefelipecgs/godot,honix/godot,Paulloz/godot,godotengine/godot,godotengine/godot,sanikoyes/godot,vkbsb/godot,Faless/godot,sanikoyes/godot,josempans/godot,MarianoGnu/godot,firefly2442/godot,vnen/godot,BastiaanOlij/godot,BastiaanOlij/godot,pkowal1982/godot,DmitriySalnikov/godot,akien-mga/godot,MarianoGnu/godot,Faless/godot,vkbsb/godot,josempans/godot,ZuBsPaCe/godot,Valentactive/godot,Faless/godot,honix/godot,Paulloz/godot,Valentactive/godot,BastiaanOlij/godot,godotengine/godot,Valentactive/godot,guilhermefelipecgs/godot,MarianoGnu/godot,Zylann/godot,guilhermefelipecgs/godot,Paulloz/godot,Faless/godot,guilhermefelipecgs/godot,Faless/godot,Zylann/godot,MarianoGnu/godot,godotengine/godot,Faless/godot,Shockblast/godot,DmitriySalnikov/godot