Walgett police: Officers threatened, spat on; man in court