More robust handling of device add/remove events