Making RazerS 3 compile on MinGW.

Includes some unmerged hotfix patches to master.