On invalid depslog header, restart build instead of showing an error.

Also add tests for invalid headers.
Merge pull request #534 from nico/invalid_log

On invalid depslog header, restart build instead of showing an error.