handle OPT_REFERRALS being set to 0

When performing a search with OPT_REFERRALS being set to 0 (which allows
quering from the root of the directory) you end up with 2 results on a
successful search, or 1 on a failed search. This has only been tested on
Active Directory so I can't say for certain the behaviour under a
different LDAP system.