[Xwt] Correctly handle a returned value of DBNull.Value

If we get this value we should treat it as null and return the
defaultValue.

Prevents a typecastexception when trying to cast DBNull.Value to
'T'.