Fix for finding testable projects

Summary:
Some project paths may contain the same directory name more than once depending on which files were modified.  Cassowary was chopping off the end of each path segment using str_replace, which matches all occurences of a string.  Once this happened with a path with duplicate dir names, the root_path was no longer valid, and test projects were never found.  Example:

/Users/username/Documents/Repositories/superapp/Android/POS/SuperApp/src/com/superapp/pos/webservices/WebServices.java

Removing the last "superapp" would also take the first one with it, changing the base path to:

/Users/username/Documents/Repositories/Android/POS/SuperApp/src/com (etc.)

This change uses substr_replace to only remove the last occurence of the substring in root_path.

Test Plan: run 'arc unit' on a project with a modified file which resides in a path similar to the one described above

Reviewers: mbishop, jmillard

Reviewed By: jmillard

Differential Revision: https://devportal.imobile3.com/D4594