Make strip_bg_char return a unique_xmalloc_ptr