Stop missing trades on chunk boundaries.
Add adaptive chunk size logic.

This commit adds adaptive chunk size logic and handles potential HTTP
errors (particularly 502) that sometimes happen with bitcoincharts. This
functionality relies on the deprecated start parameter of bitcoincharts
which is, as of the time of this commit, still functional for limiting
the number of trades returned.
Make sure there is no gap before returning.

Before exiting bitcoincharts_history, re-request the newest data to make
sure we don't leave a gap if trades happened while we were downloading
the history.