Add mutex for auth() and doflash() for flash_pvt, and modify the focus rules.