[runtime] Fix the leaking of mach ports introduced by 98bbf8512aec0fa01b4426583280f6d231d22187. Fixes #22068.