More informative exception when trying to use ``MS`` as period frequency

Closes #5332