cursor leak in avatar retrieval when no avatar

fixes #2064