@timed: also include GC time as third returned value.
REPL history: seek to end before writing; print with sinlge call.

Even better would be if we could write lock the file before doing
this and then release the lock after, to guarantee that two REPL
processes can't write to it at the same time, but this is better.

Hopefully fix #7156.