use the mutex'd curl functions properly in readCredentials