ui-shared.c: use struct strbuf instead of fmt()

Signed-off-by: John Keeping <john@keeping.me.uk>
---
Changes since v2:
- Remove an unused variable