Fix LogContext to use device_handler

LogContext was not using the new device_handler feature, making it
impossible to use the "with m.locked('candidate')" statement.