added code to exit the loop immediately if the exit is requested even when ArmZabbixAPI::mainThreadOneProc() is successed.