Fix locking for printing error messages.

The method TopLevelParser::ErrorAt applies a lock to print the error
message. Unfortunately, it keeps the lock longer than necessary,
resulting in deadlock (on following fatal message) if error recovery
is not allowed.

Fixed by limiting scope of lock to only apply to the printing of the
error message.

Modified ClFlags to allow a "reset", and made ClFlags modifiable
by bitcode munge tests. This allowed us to test this problem as
a unit test.

BUG= https://code.google.com/p/nativeclient/issues/detail?id=4138
R=jvoung@chromium.org

Review URL: https://codereview.chromium.org/1091023002
6 files changed