The show_msg() does not save correctly the errno value
The "show_msg" function tries to save the errno of the caller but there are multiple call sites before that can override the errno value.
This was actually the cause of some other bugs in the past, one being https://trac.torproject.org/projects/tor/ticket/8043.
I think the best way to deal with this issue is for the caller to make sure errno is saved. In some situations, we might NOT want this function to restore a previous errno so it should not set it.