io: don't leak memory on clean shutdown.