[IOT-3140] Fix roles deinit crash