Add permission bits to open calls with O_CREAT
Open needs a third argument if you pass it O_CREAT:
https://linux.die.net/man/3/open
This turns into a compile-time error with FORITFY, so we need this fixed
before our unbroken FORTIFY can go in.
(The TEMP_FAILURE_RETRY open isn't detected by clang FORTIFY, but I
noticed that open_reference_profile potentially passes in O_CREAT as an
open_flag.)
Bug:
32073964
Test: Now builds with clang FORTIFY; CtsCompilationTestCases passes;
manually verified that /data/misc/profiles/ref/*/primary.prof has rw
permissions after a successful `cmd package compile -m speed-profile`.
Change-Id: Ie707d5ad403d2f86c769277b3e0f147c45000a6b