Similarity between optical response kinetics of conducting polymer thin film based gas sensors and electrochromic devices