bug-fix: deferrals and their reversals

- ensure that the assignment end_datetime remains NULL until
  all tests are complete without a deferred status
- fix patch to identify cases where deferral processes failed to
  set assignment end_datetime to null