storage:ts2.py: add message id attribute to contextname

Make getcontext() use message id attribute if present. Otherwise different units
might have same id which in turn makes pootle loose another unit. Also make
getid() to use context if it is present. Qt ts can have an empty source.

Fixes bug 2901