Send error of pg_dump in file and read file when error (closes #3399)