Add a few safeguards to ensure that once priv->shutdown is set, it is not overwritten with a different value.