settings: Make print_key() not rely on null-terminated beginning of key buffer