Monitoring and controlling welding by ultrasonic means