CommsSerialPort: fix an error

declare can't be put in "try"