Fix ApiXmlFormatTest and raw mode handling in api
In the test, raw mode needs to be set after the api module
is initiated and before executed for the test to work as
intended.
In ResultBuilder, isRawMode needs to be lazy initialized.
It is always false when the api modules are constructed and
ResultBuilder constructed. It is then set later in the
api module execution process.
Bug: T59529
Change-Id: I05949bbc822250eb6ff989e0b7669dedc8ef99a7