Fix error handling in kaa_create_context()