A Swindon man has avoided being sent to prison for throwing a kitchen knife in a dispute with neighbours.