libcore: Get rid of useless mem::forget wrapper.

Fixes #15401.