On certain annihilators in prime and semiprime rings with derivations