Collect list of installed packages at end of run

Run 'dpkg -l' or 'rpm -qa' at the end of a run so we can easily see what
packages and versions are installed.  This helps rule out dependency changes
as the cause of bugs.

Compress the resulting list, when run locally the file size drops to
under 20% the original size.

Only try running dpkg -l if dpkg is installed and same for rpm.

Although we only use dpkg today, there is an effort to support rpm based
distros in devstack-gate as well.

Change-Id: I2d99ddcc7c20e0ae9ec59fe4103f1a054917c1e7
Merge "Collect list of installed packages at end of run"