rtc_time_to_tm: fix signed/unsigned arithmetic