objectstore: support sorting by a key in get_list()

ObjectStoreSession.get_list() just returns an unsorted id list. When the
caller wants to sort the list according to a key, it has to implement
the sorting code each time. This patch implement the sorting in
objectstore to make the code re-usable.

Signed-off-by: Zhou Zheng Sheng <zhshzhou@linux.vnet.ibm.com>