regedit: Simplify clean-up in get_lineA/W().