Prevent E500 when listing with null values

An image may have NULL values for 'name', 'disk_format' and
'container_format'.

Various image list operations which used a marker could return
an E500 because:

* sqlalchemy db: an illegal statement would be formed
* simple db: the sort function would error when it hit a null

To prevent this we change the behaviour so that when a NULL
is encountered we treat it as an emptry string ('') for the
purposes of sorting. This is consistent with the behaviour
for listing the db contents using 'sql order by'.

It is safe to provide the default empty string in all cases
since only string based 'sort_key' values can be NULL in the
database, eg 'size' (not a string) cannot be NULL.

Fixes bug 1183860.

Change-Id: I2187c41a3fab8b5813ba3a5e0f3249ee5dd981ed
Merge "Prevent E500 when listing with null values"