BAC-352: Redirects in shared repository don't work

* try to follow redirects before foreign repos are checked
* add profiling for wfFindFile function

@mroszka / @lgarczewski - please review, but wait for QA before clicking "Merge" :)