Bug 1043853 - Share the code for structured cloning of ImageData objects across main-thread and workers implementations; r=jst