Back in the day (medieval ones that is) saving the bacon was thought to be any part of an animal's body and it meant to save it from harm because it was valuable - food after all was valuable. ( source ) Now it means to save yourself or someone else from harm.