refactor(client): Extract common code in displayError and displayErrorUnsafe, pass in a write strategy.

fixes #1402
Merge pull request #1403 from mozilla/issue-1402-refactor-display-error

refactor(client): Extract common code in displayError and displayErrorUnsafe, pass in a write strategy.