With no data to read, don't let liblber treat us as closed

Not sure what to do when the socket really gets closed.
WIP on config support

Still needs some serious refactoring.
Outline for ldap resolution
Banishing some memleaks