IMPALA-569: Fix race in HdfsScanNode::ThreadTokenAvailableCb
IMPALA-569: Fix race in HdfsScanNode::ThreadTokenAvailableCb

This patch fixes a race where HdfsScanNode could create thousands of threads in
ThreadTokenAvailableCb, by failing to check that all ranges had not been started before
creating a new scanner thread. This lead to the new thread immediately returning (since no
work was available), releasing the thread token and therefore immediately spawning a new
thread. The fix is to check that all_ranges_started is false every time the token callback
considers starting a new thread.

Change-Id: Iaacaf5c9cafdd3b900e39db24c9a4b5cc86b1c46
Reviewed-on: http://gerrit.ent.cloudera.com:8080/350
Tested-by: jenkins
Reviewed-by: Nong Li <99a5e5f8f5911755b88e0b536d46aafa102bed41@cloudera.com>

cloudera/Impala,michaelhkw/incubator-impala,michaelhkw/incubator-impala,michaelhkw/incubator-impala,cloudera/Impala,michaelhkw/incubator-impala,cloudera/Impala,michaelhkw/incubator-impala,michaelhkw/incubator-impala,cloudera/Impala,cloudera/Impala,michaelhkw/incubator-impala,cloudera/Impala,cloudera/Impala