Sandboxing library libmemrestrict.

It intercepts malloc/free calls to calculate total allocated bytes and return
error when threshold exceeded.