Icon Downloader: Check that the existing icon is actually a valid image.
Silence some cppcheck warnings about const variables not passed by reference.
Patch to check for fcntl success

Static analysis (coverity) detected that the
system call fcntl did not check its return
value.  This patch adds in that check.

This patch also implements a more robust setting
of the fd flags (get the current flags, or'ing in
the NONBLOCK value, and then setting the flags).

Fixes coverity 1028691
Fixes #11610
strip trailing whitespace
Services: Improve channel ordering sql. This works much better with seperators like _ and . used by some, especially in the US.
Revert "Speed up and reduce temporary space of time search a lot."

There is a simpler alternate fix that doesn't affect sorting as this
one does.

This reverts commit c0c47344879d3467cfea62938a33e70278252b36.
Drop DISTINCT clause from program query, it's not required and slows down queries significantly.
Some builds of mysql don't accept INT as a castable type, use UNSIGNED instead.
cppcheck: call by reference, efficient emptyness check

remove unused prototype while here
allocate buffer for PESPacket with pes_alloc (coverity 1047220)
Explicit casts for C++11 standards compliance

Fixes #11845