[Libomptarget] Add a utility function for checking existence of symbols (#74550)

Summary:
There are now a few cases that check if a symbol is present before
continuing, effectively making them optional features if present in the
image. This was done in at least three locations and required an ugly
operation to consume the error. This patch makes a utility function to
handle that instead.
GitOrigin-RevId: 6f3bd3a2f609ca2fdb8f2c0f4122b906824ef70f
6 files changed