Fixed serial transmission bugs in MATLAB API, affecting transmission of custom pulse trains on OS X and Win XP