Fix deprecation of Foreign.Safe in base 4.8