Fixed Resource leak (RESOURCE_LEAK) 11. overwrite_var: Overwriting "pstmt" in "pstmt = conn.prepareStatement("INSERT INTO `cloud`.`ldap_configuration`(hostname, port) VALUES(?,?)")" leaks the resource that "pstmt" refers to.

Signed-off-by: Koushik Das <koushik@apache.org>
Fixed ResouceLeak on pstmtCidr in the function Upgrade430to440.moveCidrsToTheirOwnTable as reported by coverity

Fixed another leak which might occur due to outer while loop.

Signed-off-by: Daan Hoogland <daan@onecht.net>
(cherry picked from commit 004e0cbf61e9bf29bd716c8a0d7ac2f10c57433b)
Fix CID-1219920 Dereference before null check
Fix CID-1212194 Resource like dues to left-open statements and
resultsets
Fix CID-1147052 Use try-with-resources to fix the leak