fixed threading issue in frontend

Ignore-this: 41cda65a38f51cc0bf1f6423f70c7654

During destruction the connections for the signals and slots are disconnected and
if the backend requested sychronous frontend function the backend would block because
the future would never get it's value back.

To fix this I am using a timeout based wait on the future which would eventually unblock
the backend.

darcs-hash:20141026003035-c21fe-71a6b87a082c64cd04a3546d34ed25c6f67a0adb
fixed semantics in util::queue

Ignore-this: 197dc3f9f971ad8703e768ccdcc051ee

The semantics are that if the queue is done, the pop should return false.
The bug was that if there was something in the queue when the pop was called, it
returned true when the queue was done.

darcs-hash:20141026003304-c21fe-5b0f9d2d0709fcb463e880dcb8523ee245983580
prettier and some code reduction

Ignore-this: 32df986390a9be2fd1d4df8edd9ce23b

darcs-hash:20141026004746-c21fe-561af474361e11740c8766038933629f285f736d