I suspect you may have a problem with the rpmcount overflowing in between consecutive executions of loop().
I suggest you estimate the longest possible interval between executions of loop() - I suspect the Serial output will be the limiting factor on loop frequency - and work out the maximum possible number of interrupts in that period. Choose an unsigned integer type big enough to hold that value without overflow, and use that throughout your calculations.
I'm not sure why you are detaching the interrupt each time you read rpmcount, but if you're trying to ensure the rpmcount is not updated during the read operation then as a byte value that is not an issue since a byte assignment is inherently atomic; if you increase the size it might become an issue in which case you might need to disable interrupts while you do an atomic copy from the volatile global variable to a local variable and enable them afterwards. Note that disabling interrupts is not the same as detaching the handler and if an interrupt happened to occur during that precise moment when you were doing the assignment then the interrupt would only be delayed, not lost. If you detach the interrupt handler, any interrupts that occur while it's detached are lost, though. (I suspect this is what PaulS is trying to prompt you to think about.)