Fix the stack direction check again

Turns out I got it wrong.
Fix array API inconsistency

g_array_remove_range and g_byte_array_remove_range return
a pointer to the array, g_ptr_array_remove_range returns
void. Since it is pretty harmless, make it return the array
too.

https://bugzilla.gnome.org/show_bug.cgi?id=159528