Fix buffered log output behaviour
Created by: leandro-arm
This PR contains two patches to fix buffered logging issues. The first patch resolves incomplete logging when SCP_ENABLE_SUB_SYSTEM_MODE
is enabled, while the second patch prevents the system from being suspended when there are elements in the output log buffer ready to be printed.