Refactor TWAI HAL to store state information Closes IDF-1633 See merge request espressif/esp-idf!9789