Gloucester Castle: from garrison to gaol