Magnetoresistance anomaly at the transition to coherent state in SmB6