[Haskell-cafe] mallocForeignPtrArray with check against buffer overflows