nofib: catch exceptions thrown by quickcheck tests

These are then reported as failures and the tests continue, rather than aborting the program.
ray: we can get away with the cheaper `rem` instruction here