Refactor db rake tasks: extract #set_psql_env.
Take into account PGUSER environment variable in db rake tasks.