NATO Secretary General Jens Stoltenberg has told Ukraine and its allies to be prepared for a "long war" with Russia.