Implement chewing_clean_preedit_buf
Add error handling test cases for new APIs