libsmbclient is not thread-safe nor reentrant. We must protect all function calls with a global mutex, unfortunately.
This appears to be the right thing to do when we want anonymous login.