Fix share difficulty verification

This patch fixes a serious vulnerability that made it possible for a malicious miner to submit invalid shares and get them accepted.