Deprived communities lost more libraries since 2016 than richer areas did, the BBC finds