The generalized fermat equation in function fields