fix: data leak in case of error in yr_process_get_memory

Fix issue #208 

Note that the coding style is slightly different from elsewhere in libyara, but in this case it avoids some cumbersome teardowns, like:

```
  // allocate foo
  [...]

  if (error)
  {
    cleanup_foo;
    return ERROR_X;
  }

  [...]
  // allocate bar

  if (error)
  {
    cleanup_bar;
    cleanup_foo;
    return ERROR_Y;
  }

  [...]
  // allocate qux

  if (error)
  {
    cleanup_qux;
    cleanup_bar;
    cleanup_foo;
    return ERROR_Z;
  }


  // and so on
```