Work around initialization bugs

This bug fixes some bugs related to resource initialization.  Note
that these are probably not fixing the root cause, but they are making
the symptoms less severe. I happened to run into a scenario where I
triggered the problem (the editor came up blank, see issue
http://code.google.com/p/android/issues/detail?id=21935 for example),
and I verified that reopening the editor after these fixes worked.
How the resource repository came to be empty to begin with is not
clear.

In addition to issue 21935 this workaround may also help with issue
http://code.google.com/p/android/issues/detail?id=17522

Change-Id: I0166e8c58c790888d53c46ca03348a0d8edc75b0
2 files changed