[mythtv-cmyth] Refactoring schedule management

New class MythScheduleManager handles recording operations.
All related code has been refactored.

Some rules depend on the backend version. Those are handled by a version
handler, that can be extended, when a new version should be supported.

In the future main services like 'Schedule recording', 'Delete Recording'
could be transfered to the version helper as needed.
[mythtv-cmyth] Add MythConnection::GenerateRecordingPreview

This function triggers the backend to generate a preview for the given
recording.
[mythtv-cmyth] Assign RecordingStartTime to PVR_RECORDING.recordingTime

PVR seems to identify recording with key {title,recordingTime}. Using start time of EPG program make confusion between recordings of the same EPG. Assign RecordingStartTime to recordingTime instead.
[mythtv-cmyth] Keeping live recordings doesn't update recording list

This case occurs when keeping a live recording and stopping to watch it:
MythTV creates a new rule (recordid) for the recording, which is part
of our UID. So replace the old live recording without rule (recordid=0) with
this one.
[mythtv-cmyth] Add MythProgramInfo::IsLiveTV
[cmyth] Add cmyth_recorder_set_live_recording

Recording live TV show to keep it
[mythtv-cmyth] Add MythDatabase::KeepLiveTVRecording

The function triggers the backend to disables/enables auto expiration and sets
the storage group to 'Default'/'LiveTV' to keep/release a Live TV recording.
[mythtv-cmyth] Enabling 'Keep LiveTV Recording'

Live timer doesn't create a recording rule anymore. Now we set recorder and keep
recording. Backend will create rule as needed for us and no more recorder used.

Add menuhook 'Keep LiveTV recording'. The improvement is extended to keep old
live recordings using menuhook in recording screen.
[mythtv-cmyth] Use IsTunable instead of CheckChannel when switching channels
[mythtv-cmyth] Revert SwitchChannel improvement and reopen live streams again

The free input list is always empty when the recorder is locked or paused and
we reopen the live stream anyway.

Also CheckChannel fails in some cases and can break the recorder and the
recording.
[mythtv-cmyth] Don't store the file control connection in file.c

There is no need to store the file control connection since it is ref counted
in cmyth_file_create. If needed it can be accessed using cmyth_file_control.
[cmyth] Add support functions for UTC timestamps

In MythTV protocol 0.26 all commands return time values in ISO8601 format
(including a zone flag 'Z'). This patch adds support functions to process those.

The conversion from UTC timestamp to 'time_t' has been banned.
Once a timestamp created as UTC time, it can be formatted to string or others
for processing only.

Add new attribute 'timestamp_isutc' to indicate if a timestamp is in UTC time.
UTC timestamp can be create in two ways:
- by function cmyth_timestamp_utc_from_unixtime
- by function cmyth_timestamp_from_string
  Here if the string is formatted using standard ISO8601 (including 'Z')

Update 'to_string' and 'to_display' functions to consider timestamp_isutc.
Prohibit conversion in all functions using 'mktime' by returning NULL
of (time_t) -1.
Add new function 'cmyth_timestamp_to_utc' to convert local timestamp to
UTC timestamp.
Add new function 'cmyth_timestamp_isutc' to retreive the zone type of
timestamp: 1 = UTC, 0 = local
[cmyth] Cosmetics in timestamp.c

- Function cmyth_timestamp_from_tm() is locali. Set storage type to static.
- Function cmyth_timstamp_diff() should return number of seconds.
  Use difftime() from standard lib.
[cmyth] Add Live TV chain info functions

- cmyth_livetv_chain_last returns last index of the chain handle by recorder
- cmyth_livetv_chain_prog returns prog at index from the chain handle by recorder
- cmyth_livetv_chain_file returns file at index from the chain handle by recorder
[mythtv-cmyth] Rework recordings UID and recording events

Rework recording UID and the handling of recording related events since
this caused many problems (especially because of MythTV protocol changes).

The UID is now formatted like "1002 2013-08-23T14:42:00Z"
and contains the channelid and recstartts as UTC time.
Regardless of the protocol version, the UID uses UTC time only.

Depending of protocol command, the backend messages are filled with time
values in Unix time format or strings using the ISO8601 standard (whereas the
string can contains UTC or local time).
To process recording events from backend we must match the backend message
with recording UIDs.

These changes allow to resolve failure in update file size events and to clear
tricky code.

Cosmetics around recording events
- New function to handle a particular event
- New virtual function MythObserver::UpdateRecordings()
- New function to manage timeout or trigger update recordings
[mythtv-cmyth] Fix time_t related issues

- time_t is undefined arithmetic type: In GetEPGForChannel(), convert startTime
  to number of minutes since epoch before cast.
- Check times of PVRTimer: If original values equals 0 (NULL),
  time() will return current time as expected.
- Fix timeslot for all
[mythtv-cmyth] Remove overlapping EPG entries and fill gaps

PVR updates EPG entries to remove overlaps and fills gaps by updating the
start time of entries. This is a problem for the addon to match entries with
the MythTV database using channelid and starttime.

The patch makes sure to remove gaps and overlapping EPG entries before
transferring them to XBMC.
[mythtv-cmyth] Set numeric addon options to "int"

Resolves the "Need restart" after updating settings.
Requires option "int" to get *int in ADDON_SetSetting().
[mythtv-cmyth] Reload "Record template" when settings change

No need to restart, the template is loaded on addon start anyway.
[cmyth] Fix warning in mythtv-mysql.c