Corrected client counter while shutting down sendmail_thread. Added code pointer validity checks in Win32/Debug build.