Use APIPATH_MAXLEN from the right module

This fixes an AttributeError.

Change-Id: Ic76f42d7fbd6c0dd0fbdf2ccf464e8fff80b11cd