[#1913] Fix getSegmentsFromRealPath for locked filesystem.

Problem description
===================

getSegmentsFromRealPath does not work for locked filesystems.


Why we got into this (5 whys)
=============================

* There were no tests for this code and the production code was not using this method for locked filesystem.


Changes description
===================

Code for both Unix and Windows was fixed.

Build system was updated to latest repo independent version.


How to try and test the changes
===============================

reviewers @alibotean 

Check that changes are ok.

You can get latest code from server branch 1902 and run paver deps to use this version of the library.

Thanks!