Add max_usage and retval kwargs to memory_usage()

The max_usage parameter modifies the behavior of the function so that it
only keeps track of the peak mem usage over the duration of the
profiling. This is useful for profiling very long running processes.

The retval parameter is for profiling Python functions. If set, the
return value of the profiled function will be kept and returned in a
tuple along with the memory usage.

Signed-off-by: cheesinglee <cheesinglee@gmail.com>