junit: refactor v4 test to reduce code duplication

Acked-by: Karsten Schwank
Target: master, 2.7
Require-book: no
Require-notes: no
nfsv41: fix open stateid leak

OPEN/CLOSE operations should match stateid life cycle

Observed on desy CMS system

Acked-by: Karsten Schwank
Target: master, 0.5
Require-book: no
Require-notes: no