android: speed up mobile-config.py

Make it O(N) instead of O(N^2), where N is the number of children of the
root note.

3.596s -> 0.960s for main.xcd

Change-Id: I1b9904a377603cd57f84636c873ed2b752abd101