Adjusted mutex handling for ctccid (global and reader specific mutex)
Modified code to compile on Windows OS
Fixed compiler warnings