Remove empty path elements when constructing modname

Without this, autohelp fails if you don't put a trailing slash on
the input directory name.

Change-Id: I6c37636c87ad86f93d1fd7121461ce543a6260b3
Merge "Remove empty path elements when constructing modname"