A pregnant cow who became stuck in a residential swimming pool has been hoisted to safety by firefighters.