libtremor: merge upstream revision 17524 more sanity checking.