codegen: Fix (unowned foo)[] to foo[] array copy

Fixes bug 731017