Fixed dictionary serialization of reference values

Dictionary serialization methods assumed that the `IDataSerializable` type (either key or value) is always a value type. However `default(TKey/TValue)` returns null for reference types.

I also added a Test case to show that this is now working as intended