Fix filesystem leak in keg tests
Return early from resolve_any_conflicts for non-symlinks
Handle broken symlinks in resolve_any_conflicts

Fixes #33328.
Less code in begin block