Fix result export with multiple branching levels

Addresses https://bugs.launchpad.net/openquake/+bug/1098518