Assert that QueryRoot is always the first block, and only the first block.

def _sanity_check_query_root_block(ir_blocks):
    """Assert that QueryRoot is always the first block, and only the first block."""
    if not isinstance(ir_blocks[0], QueryRoot):
        raise AssertionError(u'The first block was not QueryRoot: {}'.format(ir_blocks))
    for block in ir_blocks[1:]:
        if isinstance(block, QueryRoot):
            raise AssertionError(u'Found QueryRoot after the first block: {}'.format(ir_blocks))