[pkg/term] refactor and switch syscall to x/sys Upstream-commit: 6f6ee6fd04b9a1ac91f24631cdea9453e9fd35f7 Component: engine