Fix #5339: cache dtype.__hash__.

Fix #5339: cache dtype.__hash__
extending structs breaks programs embedding this struct into other structures (unlikely) and cython checks the size of these types and complains if they are different than what the program was built with, thats just an annoyance but one that comes up very often.