libsmbclient is not thread-safe nor reentrant. We must protect all function calls with a global mutex, unfortunately.