[System.ServiceModel.Web] Fix issue with types explicitly implementing IDictionary or IDictionary<,>
Issue: The previous code, with new tests [1], failed when the linker was
enabled.
That was caused because the code looks for the Keys and Item properties
getter using reflection. The linker handled that imperfectly (it left
some holes), in part because:
* System.Collections.Generic.IDictionary`2 does not implement
System.Collections.IDictionary; and
* It preserved the explicit methods - not the implicit one that were
used the the reflection-based code;
That later fact is also a bug (without the linker involvment) and solved
by this commit. A unit test was added to show the issue (NRE).
The patch also avoid the use of reflection for IDictionary since we can
simply typecast to get the same result (without the additional cost).