Utility function wrapping the Buffer.mark call on older JDKs where it always returns a plain Buffer instead of the correct type