Floating-rate bank loans tend to do well when conditions are just right: the Federal Reserve is raising rates and the economy is growing. But such conditions typically don’t last long.