Add support for parallel queries
Add support for parallel queries

This change adds support for running multiple queries in parallel using
threads.  Fortunately psycopg2 has support for connection pools which
work with python threads, which made this change relatively simple.

For now use the block window of the reference raster as a way to
parallelize the generation.  This is perhaps not the best way to do
things, but it makes the code straightforward.

Still need to clean up things and remove the old implementation.

ricardog/raster-project,ricardog/raster-project,ricardog/raster-project,ricardog/raster-project,ricardog/raster-project