[9.18] Look for core files in $TOP_BUILDDIR
The get_core_dumps.sh script couldn't find and process core files of out-of-tree configurations because it looked for them in the source instead of the build directory.
(cherry picked from commit a13448a7)
Backport of MR !7869 (merged)