Add support for device failure event logging

-introduce KSU_EMULATOR define for PC build