Strip extension from a path