manifest_version.py: refactor GetBuilderStatus and make it more robust

This CL makes GetBuilderStatus tolerate empty or otherwise
non-unpickleable status files. It also refactors the function for ease
of testing, moves the dictionary pickling functionality into
BuilderStatus itself, and adds some unit tests to ensure correctness.

BUG=chromium:35476
TEST=New unit tests added. All tests pass. Local --buildbot --debug
tryjob.

Change-Id: I6a45158f961b4d652304f691f5fe8c828642a143
Reviewed-on: https://chromium-review.googlesource.com/190878
Reviewed-by: Aviv Keshet <akeshet@chromium.org>
Commit-Queue: Aviv Keshet <akeshet@chromium.org>
Tested-by: Aviv Keshet <akeshet@chromium.org>
2 files changed