Merge 20 Jun from SGminer v5_0
Last patch commit: https://github.com/sgminer-dev/sgminer/commit/83b2ac9ec751ee0a72a18add6e8bd9ba000098c5