Limit analysis of masonry structures with free discontinuities