Finish processing form on errors, check for valid PNM image length

If forms had errors, they would never get deleted on the website. And,
if you uploaded a non-form PDF that had PNM images with invalid lengths
it would result in memory corruption from the ilLoadL call.

However, forms now are extracted completely before starting to process
the images since we want to cancel all processing if there were errors.
Fixed condition wait when multiple waiting

Make sure that this form is the one that has changed by actually
checking the conditions we are waiting for after we wake up. I
thought the wait() call did this since we passed in a function
to check the condition, but it appears that it does not.
Check that DB command executed successfully

Previously it wouldn't notify you if you tried changing your username
to an already-taken one. Also, now we delete the user's forms on
account deletion.