fix spuriously slow check in twoway strstr/memmem cores