system: Refactor error dialog box.

When showing error message via Zenity, show the expanded (sprintf'ed)
error, not the format string. Refactor the sprintf part to be part of
the common code to avoid duplication.