I don't usually try to use medical reasons as an excuse, but being you are pretty ontop of things and this seems to be a bit out of his normal personality, have you gotten a full Physical, checking hips for soreness or ear infection and eye sights.
The reason I pinpoint those areas is eyesight could cause the off distance barking, If ears are hurting that could cause growling while being petted as hips can.
If a vet check shows nothing wrong then you know for sure as already suspected he is feeling a bit up there........
But I bet since it happens when they walk out he is being a total brat........
