pkgdb2client: Cleanup on-demand login code

- Rename login_retries to login_attempts
- Allow to set login_attempts in constructor
- Add docstring for login_callback()
- Fix typo in exception