Bugfix: Check that the stratum_share struct for a failed submission is still in the submission hashtable before trying to delete it

If the stratum share resubmission code pulls it out first, it could be gone and freed already
Bugfix: When disabling device, ensure its prev_work (if any) gets freed properly
Merge commit '707c9f6' into bfgminer-3.0.x
Check stratum socket exists and is writable before even considering whether the sessionid is the same or not

Conflicts:
	miner.c
Merge commit '7341aba' into bfgminer-3.0.x