Fix get_resources timestamp ordering for SQLAlchemy

This patch ports over the ResourceTestOrdering tests from
Ceilometer Master (Havana-3 RC-1) and applies them to the
SQLAlchemy driver for stable/grizzly along with a fix.
Partial cherry-pick from
change ID Ib09e21cbc7bbd45a6ecc321403e9947df837e14b.

Change-Id: If2d4299d17afc2d0d29433fcdccdfd5d85498cef
Partial-Bug: #1229395
Merge "Fix get_resources timestamp ordering for SQLAlchemy" into stable/grizzly