How to reproduce:
Expected behavior: new value is written to inifile
Actual behavior: new value is not written (though inifile's timestamp is updated)
This problem seems to have been introduced by commit 4a8a50154a835 which is in 2.6 but not in 2.5.
The attached patch seems to resolve the problem for me.
Fixed by 615e8348 in 2.6 and merged into master.