Final backtrace fix - setting keepGapping

For both left and upward gapping, the keepGapping flag should be set regardless of whether it is a T-based or C-based gap. Thus, the extend_flag check was moved to after the actual gapping while still inside the check for whether there should be a leftward (or upward) gap (given by keepGapping and directionMat).