Make application quit on main window close

This causes the main window to signal the application to exit and delete
its own pointer on close.  This fixes an issue where apparently some
windows that aren't explicitly connected to the main window would be
left open when the main window was closed because by default Qt will
only exit when all windows have been closed.

Because it deletes its own pointer, instead of storing it in a
std::unique_ptr, use a QPointer because it has an internal mechanism for
automatically tracking QObject deletion even if the deletion was not
done on the QPointer itself, where as unique_ptr does not have that
functionality.  In other words, if the pointer is deleted elsewhere for
whatever reason, the QPointer will still set that internal pointer value
to null.

(message and minor modificiations by Jim)
Minor refactor for creation of sub-windows

This refactors the sub-window code a bit so that instead of deleting the
window pointers, it calls QWidget::close() on them to safely trigger a
normal close on them instead (which will also delete them).  It adds an
OBSShutdown signal which will emit when the main window is being closed.