Generalized instantons in N = 4 super Yang-Mills theory and spinorial geometry