[tpuartAdapter.py] Check if context closed.
More robust option handling.