Junction conditions for generalized hybrid metric-Palatini gravity with applications