Nanowire-based gas sensors