Cyclical period changes in the dwarf novae V2051 Oph and V4140 Sgr