Infrared and terahertz studies of polar phonons and magnetodielectric effect in multiferroic BiFeO3 ceramics