Revert "Fix deadlock in ApiClient::SendMessage"

This reverts commit 0ac6e97f329b551882f925a009e6efe498ec45c3.
Revert "Fix another deadlock in ApiClient::SendMessage"

This reverts commit a0c09303251d22738f82a9c35a66d327c98699a3.
Another attempt at fixing the API deadlock

fixes #6617