Runtime error when calling `portaudio` library built with MinG-x64 on Windows
## Summary
`cabal run` fails with "ExitFailure (-1073741515)" during FFI call to portaudio C library built with MinG-x64. However, the same function succeeds when called in `ghci`.
## Steps to reproduce
1. Build `portaudio` for Windows with MinGW-x64 [using instructions here](http://files.portaudio.com/docs/v19-doxydocs/compile_windows_mingw-w64.html) (or use `pacman -Suy mingw-w64-clang-x86_64-portaudio` to install the msys2 package)
2. Add [`portaudio`](https://hackage.haskell.org/package/portaudio) to `extra-libraries` and `build-depends` and use `cabal run` to the `Main` module below. The print statement never executes, and if you use the `-v3` flag the last line states `returned ExitFailure (-1073741515)`.
```haskell
module Main where
import Sound.PortAudio
main :: IO ()
main = initialize >>= print
```
## Expected behavior
Print output of `initialize` function.
## Environment
* GHC version used: 9.2.5
* Cabal version used: 3.8.1.0
* Operating System: Windows 10
* System Architecture: x64
issue