Few fixes to problems with the CLI installation

So the first commit fixes a fatal error that I did not have with the 3.2.7.1 release but I had to fix it to test my other changes anyway.

The second commit fixes a major issue. Indeed, when trying to install TBG via the CLI with PostgreSQL, it always tried to connect to the database as the CLI user and not the user provided when the installation script asked according to the error message given by PostgreSQL. I did not try with any other RDBMS but it should not break anything. See the change but I think PDO messed up the DSN internally when it was left with an empty database field.

The third and last commit fixes a minor issue. The installation script was not able to create the 'installed' file if it does not exist even if the user running the installation has the right to write in the directory (and thus to create a new file).