Fix leaks for the combinated case that 15bpp mode and pipe mode are
enabled
Update tests