Changed to standard int types, because previous assumption about unsigned long = 32 bit is only true for 32 bit systems and 64 bit windows, its 64 bit on most other systems, that assumption broke a couple of things. 

Fixed some minor bugs related to the fetching of new work and threading
Merge branch 'master' of https://github.com/erkmos/jhPrimeminer