stratum: check if job was read

(cherry picked from commit cc296a061861ed3138a533bef550f56fe3ad7872)
groestl optimization from sp_

https://github.com/sp-hash/ccminer/commit/e3e6b24d8c21514fbd42424ce5a35db8adff72f7
echo optimization from sp_
cubehash changes from sp_