Fix for an out-of-range exception when resizing the window during funced
Addresses https://github.com/fish-shell/fish-shell/issues/498