Serialize external pointer in R with boost serialization.