haiku: Fix memory overflows

* Systems with more than 2GB of ram were
  overflowing the int32 memory storage vars.
* Limit emulated memory to 1GB if ram over
  1.2GB, otherwise limit is ram - 256MB