Fix memory leak in app_queue when a device state is changed but it isn't