Threat against shelter worker brings prison sentence