[corlib] Fix potential RegisteredWaitHandle resource leak