ini_file: replace lambda with named function

Fixes #6876