PvAPI support on Windows with MinGW (PR #1038 applied to the branch 2.4)