Fix `retract/1` built-in method type-checking bug when the argument is only known at runtime

Thanks to Andreas Becker for the bug report.