ui_newt: rework how prefix is validated when read