Fixes #5205 - Removes use of elgg_echo() for the exceptions (rebased)

Just rebased https://github.com/Elgg/Elgg/pull/5209