Adding os.path.realpath to help macos build pass tests.

Testing Done:
pants goal test tests/python/pants::

I get 3 errors when I do this locally due to the fact that scala no longer works on my box.

Bugs closed: 312

Reviewed at https://rbcommons.com/s/twitter/r/624/