A variational model for fracture and debonding of thin films under in-plane loadings