[PATCH 2/2] util: command: improve generic mass close of fds