Clear the domain on thread exit after the profile thread end hook, since it might need it to be set.