Edge fracture instability in sheared complex fluids: Onset criterion and possible mitigation strategy