wifi: fix STAs can not detect disconnection from AP when encrypt transmission is used See merge request idf/esp-idf!3907