Apple is testing an iPhone security feature designed to recognize snatch-and-grab theft and lock the device before the thief can exploit it.