Peter,
It looks like the OS X Address Book is also an LDAP implementation, as this patch entails simply changing the query from Thunderbird AB to OS X AB.
What is wrong with this implementation? If the OS X Address Book is indeed a database, it is better to query it like a database rather than trying to manipulate its underlying data file. Ditto for the Thunderbird AB...