Fix BZ892006: Make postgresql socket file access solvent and add tests f...

...or postgres and mysql socket files.