Close connection to db after send_mail command to prevent psql 'unexpected EOF on client connection with an open transaction' error