fix order_by for System.command_queue relationship

This was a typo when porting to declarative style. In SQLAlchemy < 0.8
the typo doesn't matter, because SystemActivity.id refers to the
activity.id column, however in SQLAlchemy >= 0.8 it refers to the
system_activity.id column instead, which is wrong in this case.

This also necessitated rearranged the CommandActivity class definition
to be above System.

Change-Id: Ia405307f67a6db926bde7986fe95a00bc45adeda
Werkzeug 0.9 compatibility: .get_description() now returns markup

... so we just use .description instead.

Change-Id: I15ff04f729939b759fd9f9ae68fe7c8bb9a05cb4
createrepo 0.10 compatibility: invalid RPMs are now an error, not a warning

Older createrepo would just warn about these invalid RPMs we were
creating in the test suite, but with createrepo 0.10 it actually errors
out, causing the recipe to abort.

Change-Id: I9bb059ceda0e36c66dcf39ffd6b1aaea1cd5110c
use sqlalchemy.inspect instead of poking in private attributes, when possible

The ._AliasedClass__target attribute doesn't work in SQLAlchemy 0.9,
luckily there is an official inspection API which we can use on newer
versions instead.

Change-Id: I96ec5eebb62f08cdeb3ccd07369b67690f765c5b
requests 1.2 compatibility: need to handle redirects ourselves

It seems requests 1.2.3 now converts DELETE requests to GET on 302 (I
can't find anything in the changelog about it) but we really do want to
issue the DELETE so we have to implement redirection handling ourselves.

Change-Id: I183ddcee821f2a33506aacc88dbbd75900955df7