Russian president Vladimir Putin has apologised after an Azerbaijani plane crashed in Kazakhstan, killing 38 people.