Fix Anonymous access to user profile pages

@jbau please
* Makes /accounts/profile pages only try to retrieve user information if
  the user is actually logged in. Repairs 500 error introduced by
  4ebe3bc.