Connect a PTY when preloading in background

Readline + libedit gets messed up if it loads when not connected to a
terminal. This resolves that problem.

Fixes #244.