I found a solution to this bug. Install the version of Compiz from Daniel van Vugt's ppa and that will fix this issue. Even if you restart compiz, it remains stable.
https://launchpad.net/~vanvugt/+archive/compiz ** Changed in: compiz (Ubuntu) Status: Confirmed => Fix Released -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/815996 Title: Desktop occasionally freezes/locks up when switching workspaces To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/compiz/+bug/815996/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs