[settings] Ensure fetch_string_setting() returns a NUL-terminated string