AIX fixes

So it turns out that AIX cannot allocate a 128 KB array in stack. So we
allocate the arrays in heap instead. Unixes are weird.