fix #341. Limit the amount of memory taken by query

Remove the setting for shard query buffer size and add logic for max
number of shards to query in parallel.
refactoring to make the code clear and simple and fix some bugs
Merge pull request #341 from influxdb/fix-341-query-memory-consumption

Querying large datasets take up large amount of memory