Uic: fix a leak

There are a couple of code paths in which we return from a function
without freeing the memory pointed by a local pointer.

For the sake of not over-modifying the code, I chose not to turn
"ui" into a scoped pointer.

Change-Id: I0b23944f7526d250c1ebeca0bae9bdc36dceceed
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: hjk <hjk121@nokiamail.com>