Ensure callback is only called once

This removes the need for tracking whether an error or valid
result has been encountered yet before invoking the callback.