The Scottish ancestral home of the founder of Harley-Davidson motorbikes has been rescued from demolition.