Homogenization of free discontinuity problems