Fix AvoidRepetitiveCastsRule defects

This fixes various AvoidRepetitiveCastsRule that were reported by
Gendarme.

This is for issue flibitijibibo/MonoGame#196.