http://www.dwarffortresswiki.net/index.php/Cave_spider"These can bite tame animals and your Dwarves. They cause the victim to be randomly stunned for an unknown duration. "
So Cave Spiders can bite and stun dwarfes and tame animals it seems. Never happened to me, but this might be the cause of your Mason's little... "problem"