testenv: grant_perm does a config touch to force reload of perms, as is done with revoke_perm.
Avoid later test cases failing if RegressionTestTicket10957 fails.
Refactored `grant_perm` and `revoke_perm` so that `trac-admin` is only called once.
Print the error when an exception is thrown due to a non-zero return code from calling `trac-admin`.
Put `logout` and `revoke_perm` within the `try` statement.