Control device for controlling an ac motor such as that driving an elevator