Move the loop that sets the pixels in DirectUtils::createImage from Java to a JS native

Fixes #315.
Erm, no, sorry, I just reread the code comment about Image.createImage creating a mutable ImageData instance.