Fix scope, ressource leaks in boostrap daemon

Reduce scope of config_setting_t *elem

Fix various leaks of files keys_file and pid_file
Merge branch 'bootstrap_daemon-leaks-1' of https://github.com/tux3/toxcore into tux3-bootstrap_daemon-leaks-1