When closing multiple levels, it's the first fold that gets the attachment.

Before we were putting the attachment on the fold whose
closing was requested; however, when we have levels > 1,
we're closing the requested fold plus parents. That means
the first topmost parent that we're closing is the one that
displays the attachment.
Fix an off-by-one error when scanning for the topmost fold to open.

This was affecting recursive folds where we were trying to
open a fold that had children and the request to open the fold came
from a spot after the children. It's an error we'd
already fixed in the fold closing code.