That bug was fixed a long time ago; the patch is already in Wine.
As for how to apply patches when building via Homebrew, that's something you need to ask on the Homebrew support channels, which is also where you need to ask about problems you've caused by deleting libraries.