Wind turbines in Scotland generated power equivalent to all its electricity needs for four days new analysis has shown.