core: remove trailing slash for modules as well

apply the same fix which has been made for commands:
007dbc6 Remove trailing slash if present when processing GANDICLI_PATH paths

Signed-off-by: William Dauchy <william@gandi.net>