Kroatien vendte et truende nederlag til sejr efter Kiril Despodovs røde kort og en mål fra Luka Modric og Andrej Kramaric.