Fix couple of UART issues
Fix couple of UART issues

- there was a small race in `uart_pattern_link_free`:
  `rx_pattern_pos.data` was accessed for reading outside spinlock
- `uart_flush_input` enabled
  `UART_INTR_RXFIFO_FULL|UART_INTR_RXFIFO_TOUT` intr mask on exit even
  if these flags weren't set when function was called

Closes https://github.com/espressif/esp-idf/pull/7023

espressif/esp-idf,espressif/esp-idf,espressif/esp-idf,espressif/esp-idf