vio_end() is called twice in this fragment in libmysql/libmysql.c in case of embedded server:
First time it's called from end_embedded_server() via clean_up().
Second time it's called from mysql_server_end() directly.
The problem does not show up in any ways with the standard
yassl and openssl libraries, but it's reported that mysqltest_embedded
hangs when linked against a custom built openssl library.
See the comments in the end of