Fix FBA detach then attach crash in 'attach_device'