Refactor: `Process#wait` on Windows (#17099)