Merge "Fix a bug where a NetworkAgent gets repeatedly torn down"