Fix initial page API path detection on URLs with query strings.

This fix was originally introduced in Fontello and dropped by an
accident while the last synchronization.