Fix device lock flag clear faild sometime