Avoid an apparently double-close.