correctly handle platform error in rdj assembly

Yes, `had_err` should always be type `int` and `-1` is the standard error code.