Port ExtendedPathIndex fix from ExtendedPathIndex 3.0.1

This is a port of the fix in ExtendedPathIndex 3.0.1, "Fixed depth limited searches, when the path index wasn't the first index in the query plan. Thx to Peter Mathis for reporting the problem. [hannosch]".