Fixes the "Card preview window gets stuck and can't be removed" issue by saving the cardname, instead of getting it back from the popup (with possible issues with case sensitivity). Also closes an old popup when a new is created.