WPrefs: fix memory leak in buildPLFromMenu (Coverity #50105)