Previously if we tried to added content to a local.conf file without a local section, we actually inserted that content in the wrong place at the end of the file. This fixes that, with unit tests. Change-Id: Ib886d78ce5f3718def784db59ba9abf41bdb0e7b