“the principles to be applied are fixed and clear. The assessment is made upon the same basis as that upon which damages for breach of contract would be assessed if the undertaking had been a contract between the plaintiff and the defendant that the plaintiff would not prevent the defendant from doing that which he was restrained from doing by the terms of the injunction”