A Builth Wells premature baby died as a result of amniotic fluid infection and cocaine exposure, an inquest has concluded.