1149894 - Adds a get_parent_directory that gets it right with a trailing slash

This change is the platform portion of the bugfix for 1149894. pulp_puppet [PR 138](https://github.com/pulp/pulp_puppet/pull/138) uses this new function. They need to be merged together.

https://bugzilla.redhat.com/show_bug.cgi?id=1149894
Extra ' ' before the .