Added mutex to lock vectorPortsInUseList in function AddtoPortList
Removed port check from functions flash, flashWithProgrammer, flashBootloader and added check in the new created threads.
Ports are added to vectorPortsInUseList as soon as the new thread is created and removed from vectorPortsInUseList before thread ends. Removed port check from function serialRead and added check in the new created thread serialReader.Port is removed from vectorPortsInUseList in function disconnect.
Added control in functions doflashWithProgrammer, doflashBootloader in order not to add them in vectorPortsInUseList when communication is "" or USB
Removed AddtoPortsList from serialReader and added it to openPort. Added control in do flash for Leonardo. For Leonardo the  port is added to vectorPortsInUseList when openPort is called, removed from it when closePort is called and then added again when the new port in which Leonardo connects is detected.
Added mutex to RemoveFromSerialPort function
modified openPort function type, added function AddtoPortsList before try catch in openPort, added AddtoPortsList before try catch in serialReader, call to closePort in serialReader when loop is interrupted, check the result of openPort function in doflash for Leonardo
Splitted CodebenderAPI.cpp in 3 files: CodebenderccAPI.cpp, CodebenderccAPIJS.cpp, MiscFunctions.cpp