Properly finish the scanner so it can be closed or scan again with different parameters.