Python timeout method decorator