is_path_extension function

Check if a path has a specific extension (function factory)