Rewrite manual loop to use Async.whilst.
Rewrite manual loop to use Async.whilst.

adamryman/splunk-sdk-javascript,lowtalker/splunk-sdk-javascript,lowtalker/splunk-sdk-javascript,splunk/splunk-sdk-javascript,splunk/splunk-sdk-javascript,adamryman/splunk-sdk-javascript,splunk/splunk-sdk-javascript