Wrap file open in try-except

In setenforce(), similar to getenforce()