minijail: Decouple the do_init flag

Previously, the order in which minijail_run_as_init() was called
mattered, since other methods (like minijail_namespace_pids()) could
clobber the value of the |do_init| flag.

This change uses a new flag, |run_as_init|, to avoid this problem.

Bug: None
Test: test_that ${DUT} security_Minijail0
Test: minijail0 -m -M -I -- /bin/bash -c 'echo $$'  # prints 1
Test: minijail0 -I -m -M -- /bin/bash -c 'echo $$'  # prints 1

Change-Id: Ie1de972c3b13a0efcdd32b8c11d61b610249abf4
1 file changed