check_ntp_time: Bug in average calculation

Just turning attached patch of github issue #956 into a push request