Log errors

Log the following error types:
* filename errors
* upload errors
* API error for parsing custom license text (also fix a bug in the error handling code)
* API errors when saving the final text

Form validation errors are not logged.

Uses schema https://meta.wikimedia.org/wiki/Schema:UploadWizardErrorFlowEvent

Change-Id: I8bff7cc26210100ecf5930c4e9e063b441b14ed8
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/903
(cherry picked from commit a03935973faa16d31b5e7d03a343bacfd4b5c199)