* cdrom_id: Backport two fixes from upstream git head to fix media detection
of drives:
- Fall back to CDROM_DRIVE_STATUS if the drive neither support the SCSI
"GET CONFIGURATION" nor the older (pre-MMC2) "READ DISC INFORMATION"
command. This fixes media detection on the IronKey and similar encrypted
USB sticks.
- Don't read beyond "last track" in TOC. Read the first and last track
from the TOC header, and do not go beyond that stated number of tracks
when reading the TOC. Otherwise we interpret random data which leads to
bogus tracks. (Reported on an IronKey, which reported 1 data track, and
4 audio tracks which weren't actually present.)
- LP: #653568

* Fix cdrom_id even harder to correctly detecting media. (Committed to
and cherrypicked from upstream git head):
- Rework feature/profiles buffer parsing: Previously we were ignoring many
profiles, which could lead to misdetecting the content types.
- Print more debug messages with -d.
- Do not ignore errors from scsi_cmd_run(). scsi_cmd_run() can return
positive error messages if we have CHECK_CONDITION set and get the error
code from the SCSI command result. So check the result for non-zero, not
for being negative. This fix another common cause for "phantom" media
in empty CD-ROM drives. (LP: #562978)
- Swap media state and TOC info probing. Blank CDs do not have a TOC, thus
will fail cd_media_toc() (at least with the "Do not ignore errors from
scsi_cmd_run()" fix). Thus probe the media state first, so that we can
properly detect blank media.

cdrom_id: Turns out that some ioctls do not actually touch the result
buffer in some cases, so we need to zero the result buffers to avoid
interpreting random da CD properties. (LP: #559723, LP: #561585) Patch
also committed to upstream (2b861)