Rock fails in shearing as a tuned critical system