tests: add ioctl_period test

The various corner cases of this came up recently due to e-mail
conversation with Andreas Sandberg