stop using deprecated api

Hi,

The serialport gem won't compile on Ruby 2.2 because `Check_SafeStr` has been removed.  I've fixed those spots so it works on all rubys.