pdu: fix statsn and factor out sn comparision

Signed-off-by: Peter Lieven <pl@kamp.de>