HPCC-12663 Fix assert and optimize finding free page using _builtin_ffs

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>