Updated version of exercise 17

I added the same code that exists in database close to the die function
so that any existing connection will be closed when the die function is
called. Also added a die_wo_conn function, for an instance where there
isn’t a connection to free.