If `srv` is nil, we do not have a pointer to the runtime so we can't close it.