Code which gets elements of tree in ldap moved to a common method

Code which uses 'search_s' in ldap backends moved
to a new method to remove duplication of code.

Change-Id: I5b9b89d452d6031b54ccb15cdbd9129939d29f7f
Merge "Code which gets elements of tree in ldap moved to a common method"