Mediating the relationship between loneliness and cognitive function: the role of depressive and anxiety symptoms