fix infinite loop bug in ExtractOpenRAVETrajectoryFromProfiles