Stability and accuracy of finite element methods for flow acoustics. I: general theory and application to one‐dimensional propagation