Eliminate double close of file descriptor in manager.c