Revert "Revert "Refactor argument creation to be before the fork""

Fixed incorrect closing of unique_fds.

Test: atest InstallDexMetadataHostTest
Test: adb shell data/nativetest/installd_dexopt_test/installd_dexopt_test
Bug: 119264994

This reverts commit 3163652bbe864e3998105cd2d2815af1483dcdf7.

Change-Id: I36862f8c4cafa61b0a6db4102138f1ae07427095
1 file changed