only close session if open

getJcrSession will open one if needed, which close does not need to do. This
also caused some timing issues in the REST tests as it concurrently operated
on the same session