Implemented is_safe_path, and extended ask_and_safe_open.