make sure reinit_device cannot happen while algo switching, which would probably result in segfault