AthLinks: Avoid gcc12 warning.
ElementLink::isValid was implemented by calling cptr(). However, with gcc12, this was sometimes giving dangling-pointer warnings when we were returning ElementLink instances by value, as for example happens with ElementLinkVector. Rework slightly to avoid this. Doing it like this allows us to anyway save a little work in isValid().