Fix RequestContext.to_dict user/username inconsistency

The username value should be returned, not the self.user value,
otherwise you unexpectedly get inconsistent results if you ever
override the username after creating the object.  Some tests
added, one of which illustrates the problem.

Change-Id: I95e416e3046607d8b0406812705949e8ff464f86
Closes-Bug: #1237459
Merge "Fix RequestContext.to_dict user/username inconsistency"