Wow... there is nothing wrong with what you've posted.
I can only imagine that perhaps the LDAP session has remained open... I'd check the Task Manager for any stray processes or COM connections to your LDAP server