Refresh the application list when opening the menu only when really necessary
Avoid a memory leak when icons cannot be loaded
Simplified the icon lookup code