NSW Health has apologised after people were buried in shared, unmarked graves at Rookwood Cemetery in Sydney.