If you want to automatically/quickly place the walls, then I think the layer offset idea is the better one, because you’ll be able to use edge-based terrains (available to try in the snapshot and releasing in version 1.5) to draw the wall “terrain” and have Tiled automatically place your corners and edges, and you could have single-tile-wide paths enclosed by the walls (or rather, it would be two wall tiles right next to each other, but with the ground below visible between them, since the walls would be mid-tile). This method would require 15 unique tiles.
If layer offsets aren’t an option (some importers/engines don’t support them), then you’d need special tiles for the different wall positioning on each edge. If you go with encukou’s suggestion, you will save a lot of tiles, but you will not be able to use Terrains to place them, it’ll have to be manual (or perhaps you could set up Automapping to help somehow). This approach would require the fewest tiles: south, east, south+east, corner to the south-east, a mere four tiles. A drawback of having so few tiles is you would have no opportunity for details like cast shadows from those walls, if you wanted to add those, the tile count would explode to well above either of the other options (though this could be avoided by making the shadows on a separate layer from the walls).
If you make tiles such that the walls are actually split across them, it should also be possible to set up a corner-based terrain to place these automatically as well, but you won’t be able to have 1-tile-wide gaps if you go this route. This method would require 15 unique tiles.