Fix unconditional 'true' return from StartUPnP() if HAS_UPNP is true.
Fix possible memory leak in Settings.cpp
Always close test socket in CWebServer::Start()
Convert #defines to real integral constants in SmartPlaylist.cpp

The name "group" used in these macros gets confused with the name
of the parameter "group" in various functions in this file when the
macro is expanded (See translateGroup(), etc).

This causes the sizeof() calculation to use the size of a pointer,
rather than the intended size.
Fix incorrect iterator comparison in CAlbum::Save()
Remove NULL check that can never be true.

We've already validated that render is non-null on all possible
control paths at this point.
Fix incorrect virtual override in ProfilesManager
Fix validation checks in Deserialize()
Fix possible memory leaks in iso9660.cpp
Fix possible integer overflow in udf25.cpp
Avoid possible divide-by-0 in DirectXGraphics.cpp
Check return value of GetResumeBookMark()
Fix incorret iterator comparison in MusicInfoScanner.cpp
Prevent possible divide-by-0 in karaokevideobackground.cpp
Check return of musicUrl.FromString() in GUIWindowMusicBase.cpp
Avoid incorrect signed-unsigned conversion on error in GUIWindowLoginScreen.cpp
guilib: CGUIBaseContainer::OnAction - waiting on scroll condition to be satisfied consumes the action, hence return true
fix broken channel switching by numbers after: 8768ec8a7260b7dd46c28e601a398d493808edeb
[Linux] systemd/logind/UPower power management improvements
This patch improves the power management functionality
on Linux systems running logind and optionally UPower.

While the old class was named SystemdUPowerSyscall, I renamed
it to LogindUPowerSyscall since systemd itself is technically
not used. Logind can run without systemd (Ubuntu is even planning
to do this).

The new LogindUPowerSyscall class does not inherit
from the UPowerSyscall class anymore. The little
functionality needed by UPower is implemented separately
in the rewritten class. I originally extended the existing
class, but this resulted in pretty messy code.

Advantages:
- The power management functionality provided by logind
  now works even when UPower is not available on the system. Previously
  nothing would work without UPower, even though UPower provided nothing
  but the battery level. The complete suspend/poweroff etc.
  functionality is provided by logind itself and does not rely on
  UPower anymore. The class itself checks whether UPower is available,
  and if not, avoids any battery related operations.

- As mentioned, the suspend functionality by UPower is not used anymore.
  This is also important because this functionality is being deprecated:
  see http://lists.freedesktop.org/archives/devkit-devel/2013-January/001339.html

- The OnSleep()/OnWake() callbacks now actually work. This was at least
  broken on systemd/logind systems since the corresponding UPower signals
  were never even emitted. This is now properly handled via
  logind inhibitor locks, so the system doesn't suspend until
  XBMC is finished with whatever it is doing with the callback.
  see also http://www.freedesktop.org/wiki/Software/systemd/inhibit/

- The code is imho cleaner since I don't keep a complete copy of the
  UPower devices within the class. Instead the Battery Level is
  re-read via D-Bus everytime UPower emits a DeviceChanged signal.
  UPower seems to emit this signal every 30 seconds while idle. I originally only
  re-read the data everytime the BatteryLevel() function is called since
  this doesn't seem to happen that often. However, I don't know if there
  are cases in which this function may be called very often or how
  much overhead D-Bus would actually cause in this case. Either way,
  this could easily be changed.

I made no changes to the other implementations, so this should not have
any effects on non-systemd, or to be exact, non-logind systems.
Add OnPasteClipboard method to CGUIDialogKeyboardGeneric