Fix problem of invalid datetime metadata coming from a device.
1) Catch errors in the smart device driver
2) Return None in the json_codec if a date cannot be parsed.
Merge branch 'master' of https://github.com/cbhaley/calibre
Use TLS 1.2 when available for https
Use a functionality check on the SSL module instead of checking version numbers, since there are distros out there that backport patches without changing version numbers