[Core] Close opened file descriptors before restarting.