Feature password management

Changed he resetPasswordOnNextLoginFlag to updatePasswordOnNextLoginFlag. Moved the code that reset the failedLoginAttemptsCount gets set to 0 from the unlock function to the lock function. This allows the user to to have max number of tries once the lock expires.