util/log: Convert properly between str and bytearray
Most of this file operates on strings, but there are a couple
of places operating on bytes, and we need to handle switching
back and forth between the two types in this case.
Signed-off-by: Neal Gompa <ngompa13@gmail.com>