Fix a heap-use-after-free error found by asan
Fix a heap-use-after-free error found by asan

ctx->composition().Forward() might invalidated the iterator when did a
push_back, we can't use `seg` anymore.

rime/librime,Prcuvu/librime,Prcuvu/librime,Prcuvu/librime,rime/librime,rime/librime,rime/librime,Prcuvu/librime,Prcuvu/librime