Close connection to db after send_mail command

Prevents psql 'unexpected EOF on client connection with an open transaction' error