backport 64bit patches from qemu

fixes issue https://github.com/cebix/macemu/issues/27