DO NOT MERGE Fix potential DoS caused by delivering signal to BT process

Bug: 28885210
Change-Id: I63866d894bfca47464d6e42e3fb0357c4f94d360

 Conflicts:
	btif/co/bta_hh_co.c
	btif/src/btif_core.c
Merge conflict resolution of ag/1161415 (referencing ag/1164670)
- Directly into mnc-mr2-release

void config_set_string(config_t *config, const char *section, const char *key, const char *value) {
 section_t *sec = section_find(config, section);
 if (!sec) {
    sec = section_new(section);
    list_append(config->sections, sec);
 }

 for (const list_node_t *node = list_begin(sec->entries); node != list_end(sec->entries); node = list_next(node)) {
 entry_t *entry = list_node(node);
 if (!strcmp(entry->key, key)) {
      osi_free(entry->value);
      entry->value = osi_strdup(value);
 return;
 }
 }

 entry_t *entry = entry_new(key, value);
  list_append(sec->entries, entry);
}

void config_set_string(config_t *config, const char *section, const char *key, const char *value) {
 section_t *sec = section_find(config, section);
 if (!sec) {
    sec = section_new(section);
    list_append(config->sections, sec);
 }

 for (const list_node_t *node = list_begin(sec->entries); node != list_end(sec->entries); node = list_next(node)) {
 entry_t *entry = list_node(node);
 if (!strcmp(entry->key, key)) {
      osi_free(entry->value);
      entry->value = osi_strdup(value);
 return;
 }
 }

 entry_t *entry = entry_new(key, value);
  list_append(sec->entries, entry);
}
