ESI  blocks missing when defined in a reference instead of the <block> directly.

First some example XML. We have the following XML in our `page.xml`, nothing special:
```XML
<default translate="label" module="page">
    <label>All Pages</label>
    <block type="page/html" name="root" output="toHtml" template="page/3columns.phtml">
        (...)
        <block type="page/html_header" name="header" as="header">
            <block type="ho_bootstrap/page_switch" name="store_switcher" as="store_language" template="page/switch/stores.phtml"/>

            <block type="core/text_list" name="top.content" as="top.content" translate="label">
                <label>Custom top content</label>
            </block>

            <reference name="store_switcher">
                <action method="setTemplate"><template>page/switch/stores-logos.phtml</template></action>
            </reference>
            (...)
        </block>
    </block>
    (...)
</default>
```

Somewhere later we have the following XML, please note the reference to the header:
```XML
<customer_logged_in>
    <reference name="header">
        <block type="page/template_links" name="top.links" as="topLinks" template="page/template/links/logged-in.phtml"/>
    </reference>
</customer_logged_in>
```

Please note:
- This is non-default XML, normally the `top.links` are defined directly in the header block. 
- In this example the `<reference name="header">` is in another handle, but the bug still occurs if it is in the same handle (all handles are merged to a single XML document).

With the old code the `top.links` don't show up when logged in (they do show up when logged out, but it doesn't use ESI in that case), with the new code they do show up.

If any more changes to the code are required I'd be happy to make the changes.