ruby: Use ALLOC_N to avoid potential memory leak (RHBZ#667610).