Apple to close iPhone security loophole used by police