Avoid native deadlock on finalize