Gracefully handle exceptions while grading solutions

Previously the gradeTaskSolution returned null when an exception occurred inside
while the code calling this function relied on the result being non-null. This
resulted in NPE when there was an error in the communication with an autotool
server.
Now we pass the exception to the calling code (frontend) which can therefore show
proper error messages.