Removed some excessive critical sections in motor control API