Modified type & return values of openPort function.
Addded new callback function as argument to serialRead & serialReader functions.
Reconstructed control of openPort in flushBuffer function.
Reconstructed control of openPort in doflash function before Leonardo reset.
Reconstructed control of openPort in serialReader.
Added exception handling for setDTR/setRTS functions as well as flush function in flushBuffer.
Added return value control in Serial::SerialImpl::close () in unix.cc and win.cc
Added exception handling for closePort function.
Added control if out file exists in getFlashResult function.