Use an out-of-tree unsafe-any trait instead of a home-grown version.

This has the advantage of being separately checked, tested
and documented.