Make cached_open more resilient
Make sure new in-memory tags always get updated to match msg_info
Faster quit, fix potential fd unboundedlocal errors