libmid: fix another memory leak