Mock sys.exit in testing

If exit is called during subunit then it exits the subunit process which
makes the test suite fail with no information.

Change-Id: I7c189fad05f0d38c35e4014ff414d91841bc7632
Closes-Bug: #1276885
Merge "Mock sys.exit in testing"