Fix migration from old schema.

On stoqlib.database.runtime verify if the object is from the old schema
(that had the te_modified and te_created properties), or if its from the new
schema (that has only the 'te' property)

Fixes: http://bugs.async.com.br/show_bug.cgi?id=5423
Change-Id: I43aae53dcab5e4fad7ceee57046c603c6ddfb52b
Merge "Fix migration from old schema."