Backport i2tcl's error reporting functionality into "icinga2 repl"

fixes #8078