Continuous variation of foliations in codimension two