change fcitx_ptr_array_index to use actual type, fix a bug in array_insert