Fix "Source item for keyed source doesn't exist" sync error

This could occur in 4.0 if a standalone attachment was modified locally
and remotely was changed into a child attachment.