fix brk/sbrk behavior to match the real legacy functions