Fix backup.pl for PostgreSQL local sockets

Fix #10430