[cmyth] Free chanstr in cmyth_channel_destroy

Commit 9d115f3e3181ae73fedf3165fa2576661d875d7b introduced refmem for
chanstr. Therefore it has to be freed now in cmyth_channel_destroy to
prevent leaking memory.
[mythtv-cmyth] Fix missing free in MythChannel::Number

Commit 9d115f3e3181ae73fedf3165fa2576661d875d7b introduced refmem for
chanstr. Therefore it has to be freed now in cmyth_channel_destroy to
prevent leaking memory.
[mythtv-cmyth] Fix memory leak in MythDatabase::GetChannelGroups

The function cmyth_mysql_get_channelids_in_group writes the list of
channel ids for a channel group into an array of unsigned int.
The allocation is done using ref_alloc.
We have to call ref_release also for a channelCount of 0 because
ref_alloc will also allocate memory when called with size parameter of 0.
[cmyth] Free db settings in cmyth_database_destroy
[cmyth] Remove unnecessary calls to mysql_close in cmyth_db_check_connection

The mysql connection is already closed in cmyth_database_close.
[mythtv-cmyth] Prevent MythFile::Length from returning negative number

The function cmyth_file_length returns negative numbers in case of an
error. Since MythFile::Length returns an unsigned value, this might lead into
unexpected behavior.
[mythtv-cmyth] Return proper number of recordings in FillRecordings

The function PVRClientMythTV::FillRecordings has to return the number of
visible recordings. Seems to be caused by forgotten curly braces.
[cmyth] Fix memory leak in cmyth_conn_connect_path

The call to cmyth_file_create has been moved to the end of the function.
It hasn't been removed at its original place leading to a memory leak.
[cmyth] Fix checking for valid connection in connection.c

This fixes a couple of 'Dereference before null check' issues in
connection.c.
[cmyth] Return consistent errors in connection.c
[cmyth] Return consistent errors in storagegroup.c

- Return consistent ERROR values
- Use NULL instead 0 for null pointers
[cmyth] Use cmyth_mysql_query for DML statement

Use cmyth_mysql_query instead cmyth_mysql_query_result to avoid error messages.
[cmyth] Add cmyth_mysql_keep_livetv_recording

The function disables/enables auto expiration and sets the storage group to
'Default'/'LiveTV' to keep/release a recording.
[cmyth] Add cmyth_proginfo_storagegroup

Returns the storage group for a recording.
[cmyth] Add cmyth_proginfo_generate_pixmap

Use QUERY_GENPIXMAP2 to generate missing pixmaps. (protocol version >=61)
[cmyth] Change log level in cmyth_proginfo_get_from_timeslot

Change log level for error message "...didn't recieve OK as response"
from ERROR to NOTICE since it is not an error, just indicates that a
recording couldn't be found.
[cmyth] Cosmetics in event.c
[cmyth] Cosmetics in socket.c
[cmyth] Refactor cmyth_rcv_data

This function receives raw data from the socket and thus can be used to
get all data being leftover in the socket.

Note that this private function was not used anymore, but will be used
later for the above purpose.
[cmyth] Use cmyth_rcv_data in cmyth_rcv_okay

Improve receiving leftover data in cmyth_rcv_okay by using
cmyth_rcv_data instead of cmyth_rcv_string.