Clearing flags in close_local_endpoint()