On the discriminant of twisted tensor products