Derbyshire bowlers came within two runs of Gloucestershire's all-time record for the ninth wicket