Added further changes for generating SQLite aliases.
Changes to only call the SMG$ routines when we are doing terminal
I/O.  This is based on a patch submitted by @hb-- under issue #5.

This fixes #5.