mmap: Add validation procedure to git_mmap

git_mmap implementation lacked some checks to validate the passed arguments, this commit undoes this.

NOTE: Used git interface to change the code, so please check if it does compile properly. Double-checked my changes, but there might be some warning or something else.

Signed-off-by: Raphael S. Carvalho <raphael.scarv@gmail.com>