check if byte array is list before converting to utf-8

Since F19, the keyboard section of the cpsection fails when converting a byte array to utf-8. This is because the byte array isinstance list instead of isinstance string. Not sure of the root cause of this change, but this patch checks the type and does a proper conversion in either case. (See http://bugs.sugarlabs.org/ticket/4539)