Fix crash in unloading of res_adsi module