cleanup resources should be called within IO thread if client is shutting down
Merge pull request #2093 from gurbuzali/client-shutdown-fix/3.2-RC3

cleanup resources should be called within IO thread if client is shuttin...