Use the account status changed call-back, rather the connection call back, to refresh the password. The internal password value seems to be reset by recent pidgin release during account offlining operation.
Disconnect the correct callback upon plugin onload