Update serial.c

Fixed logic setting serial rate.