[ADAM-353] Fixing issue with SAM/BAM/VCF header attachment when running distributed

Fixes issue #353. Runs header attachment per partition; not the cleanest fix, but it'll do. Modifies the SAMHeaderWritable class; without this modification, I was running into serialization issues.

@ryan-williams Can you give this a shot on your end? I've tried this on EC2 and it seems to work OK but would like to confirm that it works OK for you before merging it.
It shouldn't ever be non-zero. ;) I added this in to ensure that the computation can't get optimized out.