Hammer, sickle, crucifix? Why 20th-century communists couldn’t decide if they wanted to befriend the religious or blow up their churches