I don't think they stayed with the ship (unless maybe far out at sea, I don't know a crow's action radius hehe), but a crow would fly directly, instinctively to the nearest bit of land. Ships would use this when lost in coastal waters for example, when they lost sight of land, so that they could get a bearing to the nearest land.
Hence probably the expression.. 'as the crow flies'. i.e. shortest route to something, I reckon.
Where they were kept? no idea, I reckon that's a joke referring to the crow's nest indeed.. though that's probably not where they were kept all the time.. But I do reckon it could have been called the crow's nest because of this method since it was the tallest lookout position to observe where the crow went.
Fred