CheckIO: improved handling of functions returning pointers. Ticket: #4964