log: convert log target defined values into enum values
Also use the new enum qb_log_target_slot type in for-loops together
with a proper substitute for the literal "0" initializer.
There could be more places that might be type-substituted for this enum
(and hence possibly catch more of an incorrect usage if the compiler
or checker has some notion of enum type narrowing), but leave it as
a possible enhancement for now.