Microscopic approach to subthreshold pion production in heavy-ion collisions