Rename static variable write_index to update_index in builtin-apply.c