implement list_insert_in_workspace in plain CMake without python

This speeds up the CMake run from 12s to 8s on a workspace with ~50
packages.

The logic follow exactly the order_paths() function from workspaces.py.
The helper order_paths.py is not needed anymore.