A County Durham prisoner has been sentenced after launching a cup of urine at an officer at HMP Deerbolt.