Fix uninitialized value warning in RT::Principal::HasRight

HasRight was storing the cananicalized value of a passed-in Right
argument back in the argument hash, so the debug log output on an
invalid right had an uninitialized value rather than the invalid right
argument.

Use a temporary variable to store the canonicalized value, in case
canonicalization fails and we need access to the pre-canonicalized form.
Tests for right name canonicalization

Tests inserting into the database and pulling back out of the database.
Merge branch '4.0/uninitialized-warning-rt-principal-hasright' into 4.0-trunk