This is an attempt to fix https://bugs.llvm.org/show_bug.cgi?id=44368
This effectively reverts D1783. It doesn't break the current tests and fixes the test that this commit adds.
We now decide of a lambda linkage only depending on the visibility of its parent context.
The code is still inconsistent with the comment. Record is the lambda itself instead of the parent of the lambda.