[FaceRest] Make sure to clean up on the exit from mainThread() even if it's due to an exceptin.