ConnectionManagerESim:
1) Numerous fixes to invalid TID and invalid file mode to ensure closure
at error
2) Output fixes