trace.el: Make it usable in batch mode as well
While at it, this fixes a bug where a traced function was not
able to set `deactivate-mark`.
* lisp/emacs-lisp/trace.el (trace--insert): New function, extracted
from `trace-make-advice`. Output to stdout in batch mode.
(trace--entry-message): Rename from `trace-entry-message`.
Change calling convention. Do the insertion directly from here.
(trace--exit-message): Rename from `trace-exit-message`.
Change calling convention. Do the insertion directly from here.
(trace-make-advice, trace-values): Simplify accordingly.
(cherry picked from commit
1293aac0df4e2837a141818f225539ec847b6684)