file: Fix `join_path` to handle paths ending with a slash.

That way, we no longer need to manually remove the trailling slash before calling `join_path`.

Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>