unbind beforeunload when discarding a draft. closes #258