Making sure we call onCritical error on a separate thread to avoid dead
locks