Release menu graph references before closing

Fixes the logo not being painted occasionally when closing media and
madvr is used.