Provide a description for unknown error types
Separate error type from description with colon

This makes the error message look more like standard PHP errors.
Exit with an error code of 1

This allows the calling script to respond in an appropriate manner in
case an error occurs.
Only exit if error type is configured to HALT

Makes CLI script behave like the web app
Only print message if error type is configured to do so

If display method == DISPLAY_ERROR_NONE, don't print anything.
Don't fall through web-specific error handling

If a non-critical error occurs and we continue code execution as
configured in $g_display_errors, the web-specific handling should not be
executed.
Print backtrace when show_detailed_errors == ON
Add handling for E_DEPRECATED error type
Improve error handling for command-line scripts

Commit 461a7115d37de79e4875b651edd10fd556a533c3 added CLI-specific
handling for errors to display messages without HTML formatting.

This introduced a regression, causing scripts to abort even for
non-critical errors that would normally allow execution to continue
(such as PHP warnings as well as system and deprecated notices).
Furthermore, in that case the exit code is 0, so the caller is not able
to detect the failure to take appropriate action.

This improves how CLI errors are managed, making it similar to regular
MantisBT error handling, i.e.
  - honor $g_display_errors settings
    - abort only for DISPLAY_ERROR_HALT (in that case exit code is 1)
    - don't print message if DISPLAY_ERROR_NONE
  - handle E_DEPRECATED error type
  - improve message for unhandled error types
  - print a debug backtrace when show_detailed_errors == ON

Fixes #17270