Ignoring chdir() return value. Resetting mg_conn in close_local_endpoint()