motion_est: fix some signed overflows