Add missing function get_instance_path().

Taken from 76461c83d1807981a11f8570ba815ecb4979480e.