Check data declarations for redefinition

It's okay if the previous definition is a type declaration and the
type is unchanged. Otherwise, it's an attempt at redefinition and
is now reported as an error.

Fixes #693