[Sema] Add missing null check for `getAttachedResultBuilder`
I haven't been able to come up with a test case, but it seems like
it's possible for the attribute to be invalidated during the call
to `visitCustomAttr`, in which case `getAttachedResultBuilder` can
return `nullptr`.
rdar://118642163