Fix that the ini writer produces invalid configuration files

fixes #6614