Improve error handling and logging in the build scirpt.

This is dependent on https://github.com/OpenXT/openxt/pull/26 since it uses modules introduced there. However this can be merged later; this repo should still build without this change.

There was some error handling code but the signtool invocation was not checked.