user_ldap: Reimplement convertSID2Str() without BCMath dependency.

Also explicitly format sub-id integers as unsigned, which is required for
32-bit systems.