[gdb/testsuite] Handle core without build-id in gdb.base/corefile-buildid.exp