Fix #5339: cache dtype.__hash__.

Fix #5339: cache dtype.__hash__
there is also the issue that users can create and fill their own dtype structures, by extending it the new fields are uninitialized and in this case would cause dtypes to have random hashes.
This problem can't be avoided, but if we do it we might as well do it properly by eliminating this problem for all future additions.