endpoint: check if returned FinalizeFunc is nil before executing it
endpoint: check if returned FinalizeFunc is nil before executing it

This avoids a potential panic, specifically during the unit tests, which return
a nil `FinalizeFunc` due to `option.Config.DryMode` being set to `true`.

Signed-off by: Ian Vernon <ian@cilium.io>

michi-covalent/cilium,tklauser/cilium,tgraf/cilium,michi-covalent/cilium,tgraf/cilium,cilium/cilium,michi-covalent/cilium,cilium/cilium,cilium/cilium,tgraf/cilium,tklauser/cilium,tgraf/cilium,cilium/cilium,tgraf/cilium,cilium/cilium,tklauser/cilium,michi-covalent/cilium,tgraf/cilium,tklauser/cilium,cilium-team/cilium,michi-covalent/cilium,tklauser/cilium,cilium-team/cilium