What everyone else have said is correct, and the correct ruling is touchback. But I just want to be a bit more precise as to the actual rules. This was a loose ball that became dead behind a goal line. The ball was loose from the free kick, and it was dead by going OB. This is either a touchback or a safety, depending on the team that is responsible for the impetus on the ball at the time it became dead. Team B's muff of the kick 1) started the game clock, and 2) made it legal for team A to touch the ball (in addition to the ball being well beyond B's restraining line). But, since Team B didn't gain possession, didn't bat the ball, and didn't kick the ball, nothing else about the ball was changed. So, when the ball went out of bounds behind B's goal line, the impetus was from Team A's kick. That is simply a touchback.
Robert