Tighten enforcement of file modes.

Bug: 8275867
Change-Id: I4da14f2dd0049aca69636999696c1f3c02b3b792
Merge "Tighten enforcement of file modes." into jb42