Fix to_json for sub classes of ldap_base