Fix resource leak in kaa_read_status_ext() and fix error handling in kaa_create_context()