Fix #1058 - Add test for recursive onced functions.