SIO-1209 Ungraded submissions caused by database error

program outputting bytes invalid in utf-8 or too long output leaves
submission ungraded

Change-Id: I8f375794e7c715b3863bf5cab49e2d3e50a5861a
Merge "SIO-1209 Ungraded submissions caused by database error"