logger: refactor start_stop_logging
logger: refactor start_stop_logging

Cleans up function by reducing duplicate code and local variable count

Signed-off-by: Tal Zaitsev <6eb24f54eaf746d3a75dcf63a64261574d2f3aa0@corvus-robotics.com>

PX4/Firmware,acfloria/Firmware,krbeverx/Firmware,PX4/Firmware,krbeverx/Firmware,krbeverx/Firmware,acfloria/Firmware,krbeverx/Firmware,acfloria/Firmware,acfloria/Firmware,krbeverx/Firmware,PX4/Firmware,PX4/Firmware,acfloria/Firmware,krbeverx/Firmware,krbeverx/Firmware,PX4/Firmware,PX4/Firmware,acfloria/Firmware,acfloria/Firmware,PX4/Firmware