Refactoring and code cleanup
Remove deleting generated certs every iteration

The certs will be overwritten on the next iteration, so deleting them is
pointless.
Make polarssl report errors more accurately