KnobFile: fix iterator usage (only increment if != end())