Spain was standing between Theresa May and a Brexit deal as it threatened to derail an EU summit on Sunday if it does not get new assurances on having a say in the future of Gibraltar.