Ambipolar polyimides with pendant groups based on 9H-thioxanthene-9-one derivatives: synthesis, thermostability, electrochemical and electrochromic properties