OpenDB reads a serialized sqlite database from stdin (if piped) or creates
a fresh one, ensures the standard schema exists, and returns an open *sql.DB
along with the temp file path. The caller must call OutputDB or CloseDB when done.
OutputDB writes the database to stdout if piped, or prints a message to
stderr if stdout is a terminal. It closes the database and removes the
temp file in all cases.