rl: Add a function for freeing dynamically allocated tables.