fix deque erase, the end() iterator cannot be used as erase position.

As it is said in the doc: http://en.cppreference.com/w/cpp/container/deque/erase