Ensure JSR356 session is open before writing to it