Fix the exitcode when send the atest_exit_event

Before this cl, it is the AtestExecutionInfo class which is responsible
for sending the atest_exit_event with the exit code. And they way it
determins the exit code is to check the EXIT_CODE attribute value in
__main__, the attribute is renamed and moved outside of __main__ during
the atest refactoring, so it can not find the value and fall back to use
the default value (ExideCode.Error).

This cl fix it by passing a lambda that get the exit_code value to
AtestExecutionInfo.

Bug: 388113012
Test: make atest && atest-dev HelloWorldTests and check the log to
ensure the exti_code is set correctly.

Change-Id: I6be8d4340103165df142e87fb8f51d36aac11b10
2 files changed