Reactive and Safety-Aware Path Replanning for Collaborative Applications