make sure 'cancel' does not create empty plugins

javascript prevented the form from being sent if 'cancel' was clicked, and therefore <Empty> plugins were not deleted in the cleanup code (only affects frontend editing).
see issue #861