Reorder get config logic to avoid deadlock.

bug 428