[algorithms][distance] fix unused variable warning...

... when boost is compiled in release mode