Method decorator for retrying promise-returning functions a set number of times