Fix segmentation fault on OS X 10.9 (clang / libc++)

Accessing front() of an empty std::deque is undefined behavior.
With gcc/libstdc++ it seems fine, on clang / libc++ it causes a segmentation fault.
Merge pull request #326 from NikolausDemmel/fix-clang-mavericks

Fix segmentation fault on OS X 10.9 (clang / libc++)