copyWithinFootprint: more complete fix for respect image size

Had fixed the iteration range previously, but not the iterators, so that
it was still possible for the iterators to start off the image.  Made
things more consistent and clearer with more temporary variables.
Footprint::clipTo: optimise removal of peaks not in the new bbox

Old implementation was using std::vector::erase in a loop, which is very
inefficient for large size (e.g., when deblending a large chain of
sources).  Instead, use the erase-remove idiom.
Fits Ctor with MemFileManager: don't pre-allocate memory

cfitsio will attempt to read within this memory, which hasn't been
initialised (picked up by valgrind).  There's no need to pre-allocate
it, as cfitsio can allocate it itself, and it will initialise it how
it wants.
unreduceFromFits: allow extra char for nul

Valgrind picked up an invalid write a single byte beyond the limit of the
allocated memory.  It seems we need an extra byte to allow for a nul char.