Fix Iterator#copyToArray (fixes SI-6827).

As pointed out in #scala, when using a non-zero start it's possible
to get an ArrayIndexOutOfBoundsException due to an incorrect bounds
check. This patch fixes this, as well as another potential bounds
error, and adds test cases.

I'm not sure if this should go against 2.10 or what... I'm happy to resubmit somewhere else if necessary.