Fix the flash_pvt.py exception for headless sever.