repl: use object writer for thrown errors
This makes us use the defaults that were set for the REPL, i.e. aligns with the printing of expression completion values, and in particular enables color support.
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
tests and/or benchmarks are included -
commit message follows commit guidelines