Terminate when out-of-memory

Adding a Terminate method to the Util class, and call that method in the situation of out-of-memory instead of throwing an exception.

@emanuelez @cmelchior @bmunkholm