fix Array.concat() bug

This fixes #288.

I changed it to a do-while loop to make it more explicit that the first iteration always runs on the 'parent' array.  I'm not really experienced with C, so if this doesn't read right for a C programmer, I am happy to change it back.