core: add q_memrchr - faster memrchr version