Catch more strtol() failures when using KEYRINGs

When parsing what should be a UID while resolving a KEYRING ccache name, don't just depend on strtol() to set errno when the residual that we pass to it can't be parsed as a number.  In addition to checking errno, pass in and check the value of an "endptr".

On our testing systems, we've been seeing "KEYRING:persistent:root" being accepted as a name (attempted because the reporter had set default_ccache_name to "KEYRING:persistent:%{username}") when it shouldn't be, as reported in https://bugzilla.redhat.com/show_bug.cgi?id=1029110