Cleanup sonar driver

* spend less time in interrupt handler.
* avoid pointer usage to prevent the inclination adjusted reading being
replaced by the interrupt handler's calculation.
* only calculate the actual distance based on the measurement when
required.