Fix Anonymous access to user profile pages

* Makes /accounts/profile pages only try to retrieve user information if
  the user is actually logged in. Repairs 500 error introduced by
  4ebe3bc.
Merge pull request #2072 from Stanford-Online/jrbl-userprofile-anonymous-fix

Fix Anonymous access to user profile pages