Improve ldapsearch function

- Check result of Connection.search() before iterating through records
- Allow attributes passed to Connection.search() to be overridden
- Expand docstring
Make LDAP connections lazy & close them after use