logger: better code maintainability in rtt backend
logger: better code maintainability in rtt backend

Better use of preprocessor to be aware of external library API
changes.

Signed-off-by: Pavel Kral <dbcc8f8289ea7748ef3e2d49ba0fc4b3403d93d2@omsquare.com>

zephyrproject-rtos/zephyr,explora26/zephyr,Vudentz/zephyr,finikorg/zephyr,galak/zephyr,zephyrproject-rtos/zephyr,Vudentz/zephyr,galak/zephyr,zephyrproject-rtos/zephyr,punitvara/zephyr,finikorg/zephyr,GiulianoFranchetto/zephyr,zephyrproject-rtos/zephyr,finikorg/zephyr,galak/zephyr,Vudentz/zephyr,punitvara/zephyr,explora26/zephyr,punitvara/zephyr,finikorg/zephyr,nashif/zephyr,ldts/zephyr,GiulianoFranchetto/zephyr,GiulianoFranchetto/zephyr,zephyrproject-rtos/zephyr,explora26/zephyr,galak/zephyr,nashif/zephyr,nashif/zephyr,punitvara/zephyr,Vudentz/zephyr,galak/zephyr,ldts/zephyr,ldts/zephyr,Vudentz/zephyr,ldts/zephyr,finikorg/zephyr,nashif/zephyr,ldts/zephyr,explora26/zephyr,nashif/zephyr,Vudentz/zephyr,explora26/zephyr,punitvara/zephyr,GiulianoFranchetto/zephyr,GiulianoFranchetto/zephyr