Introduce a temporary validation function for the resource_pool to identify where the pool may be corrupted.

This feature may be matured and retained if validation against
double-releasing resources is something that should be guarded against.
lua_runtime: Fix memory leak triggered when IronBee runs out of memory.