autogenerate_config_docs: fix computing of relative path

If the git repository path (-i flag) is the name of the project (nova/, glance/,
etc), then splitting the .py file path to get a relative path doesn't work as
expected. This patch limits the number of tokens generated to get the correct
behaviour.

Change-Id: I1df7eb875c8c025ef5f82f4102f00cd13b736aea