imx: Check for NULL pointer deref before calling tty_encode_baud_rate