Error analysis of kernel EDMD for prediction and control in the Koopman framework