Fix a TOCTOU and symlink attack in netd.

Bug: 7530471
(cherry picked from commit 9065c2d7309a0c1eaed1aeb827bf293189a027e6)

Change-Id: Ie1d0fab39d0308337384be810005e0bbeb41c4a1
Merge "Fix a TOCTOU and symlink attack in netd."
Update copyright to The Linux Foundation

Change-Id: Icb90112ba40ae5ebc875cb9f0a44b17e4cbdf705