Add a construct to create conditional RAII objects