Bug 979751 - [Security setting] Redundant "Enter PUK code" page shows

after enter incorrect PIN code three times.

- update logic
- add unit test
Merge pull request #16979 from EragonJ/bug-979751

Bug 979751 - [Security setting] Redundant "Enter PUK code" page shows