chunkserver: Remove use of mmap

Use malloc to allocate memory instead of mmap.

Fix checking for allocation errors.

Change-Id: Idd4f1b39cfa4c867254c556163505a2894daa175