Forgot include needed for pthread_kill
Fix potential division by 0 if nfactor is not set
Fixed compatilibilty issues on MSVS.
Config writer fix

Reworked how the config writer works to properly save the config file.
Sometimes settings would get lost in profiles.

Also changed algorithm switch to only perform a soft reset and lowered
the verbosity of the algorithm switcher.
Fix API profile list

API Profile list showed the default profile twice.
Fixed compatilibilty issues on MSVS.
Added coding.md
improve locking to prevent race condition
stratum could respond faster than we are able to add the sent share into the hash, which could cause memory leaks
immediately exit threads if doing hard reset
Hard reset only when gpu-threads or devices are changed, but not when algorithm is changed.
Also a little refactor.

Conflicts:
	sgminer.c
If extranonce subscribe failed, do not consider it as fatal error and continue with stratum auth as usual.