OutputPopout saves files correctly

If filename doesn't end with ".txt" adds it to name, checks if file
exists, overwrite prompt.
We may want to use ".log" instead since these are optimization logs.
Tried to close connection of copied database file many ways, none worked