Stop updating logs in Preferences/Advanced when the panel is closed

With the current implementation: If the user opens the "Preferences" panel, goes to the "Advanced" tab (so that the log is shown and being updated every half-second) and closes the "Preferences" panel (now switching to any other tabs before that). Then the timer updating the "log buffer" is not stopped. That causes CP to keep an extra (very notable) load on the CPU, which is not good at all.

These code changes are fixing the problem described.