Close only if not already closed.