[RFC] Coverity Issues

This PR fixes several Coverity issues listed in #760 , namely 13796, 62607, 62608, 62609, 62612, 62615. Additionally I found that some of the Coverity defects are false positives, especially in the ressource leak category.

I couldn't find how to mark them as false positives in the Coverity web interface though. I suspect that my role of contributer doesn't have sufficient rights to do so.
There is already a fix in [#804](https://github.com/neovim/neovim/pull/804/files#diff-8127db663c9d35bef9cfa724d67eec86L307)