Stoke City edged past Leicester with a 2-1 win at the Britannia Stadium to secure their place in the fourth round of the FA Cup.