Why changing the database owner doesn't change the owner in PostgreSQL dump?
The way you are invoking pg_dump (without -C), the database metadata is not dumped at all.

Use this:

pg_dump -h localhost -U postgres database_name -C -f mydb.dump


This will add CREATE DATABASE and ALTER DATABASE ... OWNER TO to your dump.