Fix missing close() (fd leak)