Your visa should be valid only till you leave the shengen passport control. The layovers, outside the shengen area after this won't be a problem anyway.