Added SerialPortFactory with on('error'), fixed bug 226