MDL-45324 assign: notify when workflow is Off, or if state is Released

When marking workflow is enabled, students will be notified only when
the workflow state transitions to 'Released'. Until that happens,
sending of messages will be held and the 'Notify students' grading
form option will be locked.

Credit to Steve Upton and David Balch for the basis of this patch.