A simple promise retry implementation that will retry a promise X times before rejecting.