Update dlistcpp.cpp

added null head/tail case checking to append and push