mingw: fix static linking with recent ncurses