Also sets example task priorities to maximum 2, as higher priorities seem to mess with the network stack.
This code based on ESP8266 port of the embedded C client in Eclipse Paho project (http://www.eclipse.org/paho/) and it port for espressif ESP8266_RTOS_SDK by baoshi (https://github.com/baoshi/ESP-RTOS-Paho.git)