Update settings before confidence margin

Updating confidence margin is slower than updating settings, this can
result in a collision while trying to update the settings file.
Fix for #23

Prevents multiple simultaneous attempts to write to the settings file,
spawns separate threads to prevent UI deadlocks.