PTFM-12580 dx login improvements

- Allow up to 3 login retries
- Re-query username on empty input
- Cache username and password upon otp required message (which indicates username and password match)
- Produce a more specific error on otp mismatch
- Introduce a test case (disabled by default)

@kjlai to review
It would be nice if there's also a test for the OTP entry and the reuse logic.  However, I understand that it's an even harder test to set up.