use sudo to run the pg_dump so that it works with 11.1.3

Found that the pg_dump command no longer worked with the 11.1.3 chef-server security patch.

Now sudo-ing to the opscode-pgsql user and allowing group write access to the backup directory.

Also changed to using the -f option for the output file because stdout redirection can have issues under sudo.