Preserve perspectives when deleting a frame

Currently, when a frame is deleted, the perspectives associated with
that frame is lost.  This commit preserves the perspectives by
transferring them to another visible frame when available. Or saving the
perspectives from the last visible frame when emacs is running in daemon
mode so that they may be later restored.

Known Issues:
 - When restoring the last visible frame in daemon mode, the previous
   activated perspective is not reactivated.  This is a deliberate
   choice, because saved window configurations does not transfer across
   frames ('persp-import' has the same problem), so reactivating the
   previously activated frame may inadvertently show a buffer from
   another perspective, which is undesirable.

#41