Only set userEditCount if the user is logged in

If the user is logged out, the editCount will be null which doesn't
conform to the schema which requires an integer for editCount.

Change-Id: I901fd2ca74a4ebf4c630b6d23c77e3bb9c4ad3bd