Drying and percolation in correlated porous media