Move from stack to heap allocations where needed to avoid out-of-bounds writes resulting in stack corruptions caused by strcpy/strcat and alike.
Tested using `wine shell32_test.exe.so shlexec` (64-bit only). Expected output:
`0020:shlexec: 1724 tests executed (43 marked as todo, 0 failures), 0 skipped.`
This change is based on https://www.winehq.org/pipermail/wine-devel/2021-May/187791.html and fixes some of the missing bounds checks in this file.