Can confirm that the above way of farming skeletons have always worked. I've used this setup for years, and now it's no longer working. I can understand that mobs need their "eyes" to see things for the AI to kick in, but for wolves to need to see the skeleton's "eyes" in order to attack just seems unnecessary.
I've had a similar experience with villagers disappearing from some simple iron-farms I've built. However, it seems that villagers placed in water (so that they bounce up and down) do not despawn. I noticed that my villager breeder setup (where they are all bouncing in water) do not lose villagers, even though they are crammed into a 1x1x3 space. Also got some villagers in a villager transfer tube (using water) who hasn't despawned despite being there for a very long time. So perhaps this is a temporary fix, at least until Mojang does something about it (Hopefully it will be fixed in 1.9)
EDIT: I am using MC 1.8.8 btw
Still an issue in 1.18.1, and they spawn inside stairs and chests too.