pkgdb2_cli: Ask for password only if required

Use login_callback to ask for username/password only when it is
required.