Fix idxstats error and add test

This fixes an error caused by prematurely closing the BAM/SAM/CRAM file it is gathering stats for.
We have also added a quick test for idxstats and relocated files to make this possible.

Signed-off-by: Martin O. Pollard <mp15@sanger.ac.uk>