We can't connect to a GBT pool at all with fix protocol enabled.
api.c: Release io_data->ptr when releasing io_data in io_free()
api.c: Release apisock on error in api()
api.c trylock() add missing locklock
Provide a function for setting the work ntime.
Don't run device restart code if the device is not enabled.
Do not hold the mining thread lock in restart_threads when calling the driver flush work commands.
Set priority of various threads if possible.

Conflicts:
	cgminer.c
Prevent a deadlock with use of restart_threads by spawning a thread to send the driver flush work messages.

Conflicts:
	cgminer.c
Update api example compilation instructions.
line 2913 added urlencode

There was a cross site scripting vulnerability due to insufficient input sanitation on the $pg parameter.  This patch fixes that issue.
Decrement json references in api.c to not leak memory.

The json_val in api.c is a borrowed reference, not a new one so don't decref it.
Provide a function to discard queued work based on age. (NOTE: may be unused)
Silence irrelevant warning.
Drop json stratum auth failed message log level to verbose.
Initialise devices before attempting to connect to pools to allow their thread prepare function to be called before having to connect to pools.

Conflicts:
	cgminer.c
Fix json parsing in api.c
Fixed one byte stack overflow in mcast recvfrom.

The actual overflow happens when enforcing the NULL termination shortly
after the recvfrom.
Quieten down jansson component of build.
Replace deprecated use of INCLUDES with _CPPFLAGS.

Conflicts:
	Makefile.am