Make @handle_errors support any kind of function

This hack lets the @handle_errors decorator be used on
functions, methods, static methods and class methods,
without having to worry about how many parameters the
function takes, and whether there is "self" or not.

Change-Id: Ie34d200939dbadae0771da893e563995cd3ecf45
Merge "Make @handle_errors support any kind of function"