[DDMD] Replace implicit conversions to and from class pointers with explicit casts