games/gzdoom: fix wildmidi crash
get_patch_data() may recurse on itself, which is not OK to do while
using std::lock_guard<>. Move the contents of get_patch_data() to a
get_patch_data_locked() that may recurse on itself.
This is a direct commit to quarterly, as this has since been fixed by
the version present in main. Specifically, a later refactoring ends up
dropping the patch_lock entirely after get_patch_data() and friends are
pushed into an Instruments class anyways.
Based on triage work and an initial patch by wpaul@.