esp_flash: fix the set/get write protection functions (backport v4.0) See merge request espressif/esp-idf!5832