Reload modules when a ports state installs packages

Since ports states modify the package database, the pkg database should
be reloaded when a port is installed.
Fix roles query

This fixes #10437.
Merge pull request #10495 from terminalmage/ports-reload-modules

Reload modules when a ports state installs packages
Wrap file open in try-except

In setenforce(), similar to getenforce()
Merge pull request #10501 from holmboe/enforce-open-except

Wrap file open in try-except
Merge pull request #10499 from makinacorpus/pgsql

Fix roles query