Make "Can't set headers after they are sent." catchable

fixes #28