fixed static checker warnings

unused variable _ls_oldhead and _tmp plus a potential null pointer
dereference with _ls_tail. 78 tests conducted, 0 failed.
Merge pull request #2 from moreandres/cleanup

fixed static checker warnings