Fix Exception on Expiry Output Option Used

fix expired tile generation, wasn't getting out of copy mode before trying to use the prepared statement get_wkt to delete ways found in a relation

This fixes issue #219