Buying miles from airline or hotel loyalty programs isn't usually a great deal, but there are some instances where you could come out ahead.