catalyst_api: handle the last path entry in the envvar

The last path entry is terminated by `pathsep` getting to the end of the
string which leaves the loop without checking if `curpath` has been

Fixes: #10
9 jobs for !58 with handle-last-path-entry in 3 minutes and 25 seconds (queued for 12 seconds)
latest merge request