Some repl.scm fixes + secd.c is now tty-aware