ui-shared: suppress "maybe uninitialized" warning

"len" is used only if "item && tail" and is initialized only when "tail"
is set to be non-null so we are using it safely.  Use the "var = var"
trick to suppress the GCC warning.

Signed-off-by: John Keeping <john@keeping.me.uk>