There is never a safe way to do an abnormal shutdown. But it seems you will have to or wait until DU finishes whatever you had it do. If you don't wish to wait (or if DU has stopped responding) then press the Power button and hold it in for about 6-10 seconds. Now restart into the Recovery HD. Select DU from the main menu and click on the Continue button. Select the startup volume in the sidebar (usually Macintosh HD) and click on Repair Disk. If the disk is OK then click on the Repair Permissions button. If everything is OK then quit DU and return to the main menu.Select Reinstall Lion/Mountain Lion and click on the Continue button.
When you need to reinstall Lion or Mountain Lion just do the following:
Reinstalling Lion/Mountain Lion Without Erasing the Drive
Boot to the Recovery HD: Restart the computer and after the chime press and hold down the COMMAND and R keys until the menu screen appears. Alternatively, restart the computer and after the chime press and hold down the OPTION key until the boot manager screen appears. Select the Recovery HD and click on the downward pointing arrow button.
Repair the Hard Drive and Permissions: Upon startup select Disk Utility from the main menu. Repair the Hard Drive and Permissions as follows.
When the recovery menu appears select Disk Utility. After DU loads select your hard drive entry (mfgr.'s ID and drive size) from the the left side list. In the DU status area you will see an entry for the S.M.A.R.T. status of the hard drive. If it does not say "Verified" then the hard drive is failing or failed. (SMART status is not reported on external Firewire or USB drives.) If the drive is "Verified" then select your OS X volume from the list on the left (sub-entry below the drive entry,) click on the First Aid tab, then click on the Repair Disk button. If DU reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported click on the Repair Permissions button. Wait until the operation completes, then quit DU and return to the main menu.
Reinstall Lion/Mountain Lion: Select Reinstall Lion/Mountain Lion and click on the Continue button.
Note: You will need an active Internet connection. I suggest using Ethernet if possible because it is three times faster than wireless.
If you intend to erase the startup volume before reinstalling then do this:
Install or Reinstall Lion/Mountain Lion from Scratch
Be sure you backup your files to an external drive or second internal drive because the following procedure will remove everything from the hard drive.
Boot to the Recovery HD:
Restart the computer and after the chime press and hold down the COMMAND and R keys until the menu screen appears. Alternatively, restart the computer and after the chime press and hold down the OPTION key until the boot manager screen appears. Select the Recovery HD and click on the downward pointing arrow button.
Erase the hard drive:
1. Select Disk Utility from the main menu and click on the Continue button.
2. After DU loads select your startup volume (usually Macintosh HD) from the
left side list. Click on the Erase tab in the DU main window.
3. Set the format type to Mac OS Extended (Journaled.) Optionally, click on
the Security button and set the ZeroData option to one-pass. Click on
the Erase button and wait until the process has completed.
4. Quit DU and return to the main menu.
Reinstall Lion: Select Reinstall Lion/Mountain Lion and click on the Install button.
Note: You will need an active Internet connection. I suggest using Ethernet if possible
because it is three times faster than wireless.